Essential structures
Master arrays and strings first, then linked lists, stacks, queues, sets, hash maps, trees, heaps, and graphs.
Choose based on operations
Ask whether the problem needs fast lookup, ordered traversal, priority access, insertion, deletion, or relationship modeling.
- Lookup and membership
- Insertion and deletion
- Ordering and traversal
- Memory and implementation cost
Connect structures to algorithms
Breadth-first search relies on a queue, depth-first search often uses a stack or recursion, and priority-based problems commonly use a heap.