Skip to content

Contents

Six parts, 23 chapters. Read them in order, or start withthe memory hierarchy, which is the one that changes how the rest of them read.

Part I · Foundations

  1. 1Introduction to Data Structures and Algorithms

    What a data structure actually is, and why the choice of one decides the shape of everything above it.

  2. 2Time and Space Complexity AnalysisInteractive

    Big-O, and the two things it hides — the constant factor and the memory hierarchy — that decide which O(n) actually wins. Measured live.

Part II · Linear Structures

  1. 3Arrays and StringsInteractive

    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.

  2. 4Concurrency for Data StructuresInteractive

    Locks, atomics, and what "thread-safe" costs you — with the data race and its fix animated step by step.

  3. 5Memory Hierarchy and PerformanceInteractive

    Cache lines, prefetchers, and the 100× that Big-O cannot see. Measured live, in your browser.

  4. 6Linked ListsInteractive

    O(1) insertion — bought by giving up the contiguity that made arrays fast, a trade real hardware rarely rewards. Measured live.

  5. 7Stacks and QueuesInteractive

    The two most useful restrictions on a sequence — LIFO and FIFO — running everything from your call stack to message brokers.

Part III · Non-Linear Structures

  1. 8Trees and Binary TreesInteractive

    Ordering and O(log n) at once — the thing hash tables threw away — plus why databases don’t actually use binary trees.

  2. 9String Search Algorithms

    KMP, Boyer-Moore, Rabin-Karp — and why the naive scan often wins in practice.

  3. 10Recursion and Backtracking

    The call stack as a data structure, and pruning as the only thing that makes search tractable.

  4. 11Sorting Algorithms

    From quicksort to Tim Sort, plus the branch predictor that decides which one is fast today.

  5. 12Hash Tables and HashingInteractive

    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.

  6. 13GraphsInteractive

    Traversal, shortest paths, A*, flow, and the representation choices that dominate runtime.

Part IV · Algorithm Design

  1. 14Dynamic Programming

    A taxonomy of DP patterns, and the space optimizations that turn a table into a row.

  2. 15Searching Algorithms

    Binary search, and why a linear scan beats it on small arrays every single time.

  3. 16Heaps, Tries, and Beyond

    Fibonacci heaps, suffix arrays, persistent structures, and when the constant factor kills them.

  4. 17Problem Solving Strategies

    Pattern recognition as a learnable skill, with a framework for the interview and the job.

  5. 18Greedy Algorithms

    When local choices are provably global, and how to tell before you ship.

  6. 19Divide and Conquer

    Recurrences, the master theorem, and cache-oblivious algorithms that win for free.

Part V · Advanced Topics

  1. 20Modern Optimizations

    SIMD, branchless code, false sharing, and the tricks that separate fast from fastest.

  2. 21Benchmarking and Load Testing

    How to measure without lying to yourself. The chapter most books skip entirely.

Part VI · Storage Engines at Scale

  1. 22B-TreesInteractive

    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.

  2. 23LSM TreesInteractive

    Turning every random write into a sequential append — the engine behind RocksDB, Cassandra, and the write path of modern data infrastructure.