Stacks and queues
Last-in-first-out and first-in-first-out structures and the problems they solve.
- Stacks: push, pop, peek; array and linked implementations A stack adds and removes at the top only: last in, first out. Watch push, pop and peek on array and linked implementations.
- Queues: enqueue, dequeue; circular buffer A queue adds at the back and removes at the front: first in, first out. A circular buffer reuses its slots as head and tail wrap around.