Data structures, down to the cache line and out to the cluster.
Most books stop at Big-O. This one shows what the machine actually does — cache misses, memory layout, branch predictors — and how the systems you use every day, from Redis to OpenSearch, turn these structures into infrastructure that scales.
Below are two loops with identical complexity. Run them on your own hardware.
Same operations. Same asymptotics. Same code path.
Two pointer chases over an identical 32 MiB array. One follows i → i+1; the other follows a random cycle. Big-O calls both O(n) and cannot tell them apart.
From the cache line to the cluster
Each structure is followed from what the CPU does with it — cache, memory layout, branch prediction — up to how it shards across a fleet of machines. The span no other DSA book covers.
Measured, not asserted
The benchmarks run in your browser, on your CPU, while you read. No screenshots of someone else's laptop, and no numbers you have to take on faith.
Connected to production
Every chapter ends where the structure actually ships — Redis, Postgres, the Linux kernel, OpenSearch shard routing — in modern C++ that compiles, with the invariants and failure modes spelled out in every chapter.
The book
23 chapters, about 600 pages. Free forever.
Foundations
What a data structure actually is, and why the choice of one decides the shape of everything above it.
Big-O, and the two things it hides — the constant factor and the memory hierarchy — that decide which O(n) actually wins. Measured live.
InteractiveLinear Structures
The structure the hardware loves: why contiguity makes arrays fast, how layout (AoS vs SoA) decides their speed, and where columnar databases take it. Measured live.
InteractiveLocks, atomics, and what "thread-safe" costs you — with the data race and its fix animated step by step.
InteractiveCache lines, prefetchers, and the 100× that Big-O cannot see. Measured live, in your browser.
InteractiveO(1) insertion — bought by giving up the contiguity that made arrays fast, a trade real hardware rarely rewards. Measured live.
InteractiveThe two most useful restrictions on a sequence — LIFO and FIFO — running everything from your call stack to message brokers.
InteractiveNon-Linear Structures
Ordering and O(log n) at once — the thing hash tables threw away — plus why databases don’t actually use binary trees.
InteractiveKMP, Boyer-Moore, Rabin-Karp — and why the naive scan often wins in practice.
The call stack as a data structure, and pruning as the only thing that makes search tractable.
From quicksort to Tim Sort, plus the branch predictor that decides which one is fast today.
Why they exist, why chaining loses to open addressing on real hardware, and how the same idea scales from a dict to OpenSearch shard routing. Measured live.
InteractiveTraversal, shortest paths, A*, flow, and the representation choices that dominate runtime.
InteractiveAlgorithm Design
A taxonomy of DP patterns, and the space optimizations that turn a table into a row.
Binary search, and why a linear scan beats it on small arrays every single time.
Fibonacci heaps, suffix arrays, persistent structures, and when the constant factor kills them.
Pattern recognition as a learnable skill, with a framework for the interview and the job.
When local choices are provably global, and how to tell before you ship.
Recurrences, the master theorem, and cache-oblivious algorithms that win for free.
Advanced Topics
Storage Engines at Scale
Why every database index is a B-tree and not a binary tree: wide, cache-line-sized nodes turn 20 cache misses into a handful. ~8× faster, measured live.
InteractiveTurning every random write into a sequential append — the engine behind RocksDB, Cassandra, and the write path of modern data infrastructure.
Interactive