Dynamic Data Structures (cont)
Stacks are a form of linked lists used to model:
- moving boxes
- placing and removing many rings on a (single) finger
- putting plates away in the cupboard and then setting the table
- many cars going down a one-way street that is blocked and having to back out again
- calling functions in C
- page-visited history in a Web browser
- undo sequence in a text editor
- checking for balanced braces
- postfix calculator
They are examples of Last In, First Out (LIFO)
|