Core Data Structures
How work grows with input, then the structures that keep it small: a sorted array halved, a heap that always knows its minimum, a table that hashes to its slot, sets that merge in a few hops, a tree that rebalances, a list that skips, two arrays that make a set over small integers, a row of bits that remembers what it saw, counters that estimate a stream, registers that count distinct items in a few bytes, a tree whose every version survives, and subproblems solved once.
Algorithms & Data Structures
- 1
Big-O, Visuallyin review
Algorithms · Analysis · ~20 minFive routines run over arrays that keep doubling. Watch how each one's step count answers the doubling: the same, one more, twice, a bit over twice, four times. That answer is its order.
- 2
Binary Searchin review
Algorithms · Searching · ~20 minA sorted array answers a question with one read: the middle rules out half the cells. Watch the range halve to the target or close on nothing, and see why a scan needs n reads where this needs log n.
- 3
Heaps & Priority Queuesin review
Algorithms · Data Structures · ~25 minOne array read as a tree that always knows its minimum: a push climbs, a pop sinks, and building from a batch costs less than pushing one by one, every hop bounded by the height.
- 4
Hash Tablesin review
Algorithms · Data Structures · ~25 minA key's slot is computed from the key itself, so a lookup goes straight there. What happens when two keys want one slot, why the load factor governs every cost, and when the table doubles.
- 5
Union-Find: Disjoint Setsin review
Algorithms · Data Structures · ~25 minA forest of parent pointers answers 'are these two in the same set?' in a few hops: find climbs to a root, union hangs one root under another, and two tricks keep every tree nearly flat.
- 6
Balanced Trees: AVL & Red-Blackin review
Algorithms · Data Structures · ~30 minA search tree is only as fast as it is shallow. Watch sorted keys hang a plain tree into a chain, then watch an AVL tree rotate on the way back up and stay a few levels deep.
- 7
Skip Listsin review
Algorithms · Data Structures · ~25 minA sorted list with express lanes: coin flips at insertion set each key's tower, a lookup walks right and down in about 2 log n hops, and nothing ever rotates.
- 8
Sparse Setsin review
Algorithms · Data Structures · ~25 minTwo arrays make a set over small integers with O(1) insert, remove, membership, and clear, no clearing of memory needed: dense packs the members, sparse points each value at its slot.
- 9
Bloom Filtersin review
Algorithms · Data Structures · ~25 minA row of bits and a few hashes answer 'have I seen this?' with no false negatives and a tunable chance of a false positive, in space far smaller than the keys themselves.
- 10
Count-Min Sketchin review
Algorithms · Data Structures · ~25 minA few rows of counters, each indexed by its own hash, estimate how often anything appeared in a stream: never below the truth, rarely far above it, in space that ignores the stream's length.
- 11
HyperLogLogin review
Algorithms · Data Structures · ~25 minCount distinct items in a stream with a few bytes: hash each one, let the longest run of leading zeros in each bucket estimate the count, and average the buckets harmonically.
- 12
Persistent Data Structuresin review
Algorithms · Data Structures · ~25 minInsert into a tree without touching the old one: copy the path from the root, share every other subtree, and every version stays readable forever at a logarithmic cost per change.
- 13
Dynamic Programming: Overlapping Subproblemsin review
Algorithms · Dynamic Programming · ~25 minThe fewest coins for an amount, defined by its own smaller copies. Plain recursion solves the same amounts again and again; a memo solves each once, and a table needs no recursion at all.