First page Back Continue Last page Graphics
Stacks
Stack: a data structure that supports:
- Push() [ pushes an item onto the top of the “stack” ]
- Pop() [ returns the item on the top of the “stack” ]
The effect that the next item “removed” is always the last item that was added.
Arrays and Linked Lists both support stack behavior as long as you add and remove items from the same end all the time.