Data structures choose how values are stored and accessed; algorithms choose how work grows with input. This directory ties those two decisions to concrete constraints instead of presenting isolated tricks.
Choose a starting point
Start with arrays, strings, linked structures, stacks, and queues. Move to trees, graphs, searching, and dynamic programming after you can state the invariant and the cost of each operation.
- Data Structures
- Resizable arrays: account for growth and shifting
- Singly linked lists: preserve head and tail invariants
- Stacks: last-in-first-out for reversible edits
- Hash maps: keyed lookup with collision and load costs
- Binary search trees: preserve order through every branch
- Graphs: adjacency lists and breadth-first reachability
- Fenwick trees: update points and query prefix totals
- Project: choose structures for a dispatch board
Common Mistakes
An asymptotically faster method may use more memory or lose to a simpler scan on small input. Check worst-case behavior, mutation rules, and edge cases before applying a pattern.
