previous | start | next

## Stacks and Queues

- Stacks and queues are special data types that allow insertion and remove of items at the ends only, not in the middle.
- A stack lets you insert and remove elements at one end only, traditionally called the top of the stack.
- To visualize a stack, think of a stack of books.
- Since items can only be added or removed from the top of the stack, they are removed in the order that is opposite from the order they were added.
- This is called last in, first out or LIFO order.
- The addition and removal operations are called `push` and `pop`.

previous | start | next