Ganesh wrote:
I am not sure if this question is relevant here.
No, but that's okay.
Why is 'heap' (the
place where dynamic memory allocation occurs) called so? There is also
a data structure called 'heap'. What is the connection?
"Heap" contrasts with "Stack". The latter is a Last-In-First-Out structure,
like a stack of plates. You put new ones on top, and pull them off the top.
You don't (typically) reach into the stack and pull items out of the
middle.
In memory, putting and pulling are allocating and de-allocating.
In a heap, you can reach anywhere into the heap to allocate, and you can
de-allocate in any order, not just the reverse order you allocated.
There is no other reason. If the inventor of the first heap had called it a
"pile", "bag", or "shelf", that's what we would go with to this day.
--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!