|
heap and stack are two different type of objects. The main differences are how stuff gets put on the heap as well as how they are take off. There are different types like FIFO which stands for first in and first off. In essence the first thing you put on will be the first thing that comes off in relation to all the other objects you add. There is also LIFO which is last in first off. So you start to see a pattern? As for heaps they are a different data type and store information differently. So depending on your program the way things get stored and how they get removed will depend on whether you want a heap or a stack.
Jason
|