Stacks
Last-In-First-Out (LIFO) data structures where elements are added and removed from the same end (top). Stacks naturally model problems with nested or sequential processing like expression evaluation and function call management. Push adds elements, pop removes the top element, peek views without removal. Stacks have O(1) push and pop operations.
Real World
Google Chrome uses a stack for its back button — each page you visit is pushed onto the stack, and pressing back pops the most recent page off the top.
Exam Focus
Always name all three operations (push, pop, peek) and state LIFO — omitting any loses marks on definition questions.
How well did you know this?