Free & open source
Data structures &
algorithms, in depth.
Read it, watch it, run it, build it.
- 180
- Topics
- 69
- Simulators
- 22
- Builds
- 180
- Videos
- 720
- Questions
Try it live
CPU 64-Byte Cache Line & Stride Locality Simulator
64B Cache Line (8 × 8B)
Compare contiguous stride-1 traversal (1 cache miss per 8 elements, ~4 cycles L1 hit) against stride-8 and heap pointer-chasing (100% cache misses, ~200 cycles RAM stall).
Step 1 / 12
Timeline
Invariant & State
Access index [0] (Cache Line #0): Cold Cache Line Miss (+DRAM stall)
Cache Line #0 (64 Bytes = 8 × int64) — RESIDENT IN L1 CACHE
0x1000
12
MISS (DRAM)
0x1008
45
In L1
0x1010
78
In L1
0x1018
23
In L1
0x1020
56
In L1
0x1028
89
In L1
0x1030
34
In L1
0x1038
67
In L1
Cache Line #1 (64 Bytes = 8 × int64) — NOT IN L1
0x1040
91
Cold
0x1048
14
Cold
0x1050
29
Cold
0x1058
63
Cold
0x1060
82
Cold
0x1068
37
Cold
0x1070
50
Cold
0x1078
74
Cold
Accesses
1 / 12
L1 Cache Hits
0
Cache Misses
1
Cumulative Cycles
60 cy (~60.0 cy/op)
[Step 1] Read A[0] = 12 at 0x1000 -> CACHE LINE FILL (fetched 64B block)
In every lesson
Intuition first
Hand-picked videos
Diagrams & notes
Audio narration
Check yourself
Code you can run
22 from-scratch builds
Dynamic Circular Buffer & Amortized O(1) VectorO(1) LRU and Frequency-Bucketed LFU Cache EngineOpen-Addressing Robin Hood Hash Map with Backward-Shift DeletionSpace-Efficient Bloom Filter & Fingerprint Cuckoo FilterHybrid IntroSort & Quickselect Order-Statistic EngineIndexed d-ary Priority Queue with O(log_d N) Decrease-KeyLeft-Leaning Red-Black Order-Statistic TreeImplicit Treap Rope with O(log n) Split, Merge & Lazy ReverseFenwick Range-Update Range-Query Tree & O(log n) Binary LiftingSegment Tree with Affine Lazy Propagation & Monoid BeatsPersistent Segment TreeAho-Corasick Multi-Pattern Automaton ScannerSuffix Array (Prefix-Doubling), Kasai LCP & RMQ Substring IndexThompson Lockstep NFA Regular Expression EngineTarjan Strongly Connected Components & Linear-Time 2-SAT SolverA* & Bidirectional Shortest-Path Router with Consistent PotentialsRollback Disjoint-Set Union & Offline Dynamic Connectivity EngineDinic Blocking-Flow Max-Flow, Min-Cut & Bipartite Matching EngineKnuth Algorithm X & Dancing Links (DLX) Exact Cover SolverHirschberg O(n)-Space Divide-and-Conquer Sequence Alignment & DiffLi Chao Segment Tree & Monotonic Convex Hull Trick DP EngineMulti-Dimensional k-d Tree with Branch-and-Bound k-NN & Range Search
Curriculum
Foundations, Memory Hierarchy & Linear Structures
1.1
Asymptotic Analysis, Recurrences & Memory Hierarchy
1.2
Contiguous Arrays, Bit Manipulation & Pointer Idioms
1.3
Linked Structures, Monotonic Stacks/Queues & Cache-Conscious Lists
Hashing, Sorting & Divide-and-Conquer
2.1
Hash Tables, Modern Probing & Probabilistic Sketches
2.2
Sorting Mechanics, Hybrid Sorts & Linear-Time Order Statistics
2.3
Binary Search on Monotonic Spaces & Divide-and-Conquer
Trees, Balanced Hierarchies & Range Queries
3.1
Binary Trees, Traversals, BSTs & Priority Heaps
3.2
Self-Balancing, Augmented, Disk-Backed & Persistent Trees
3.3
Range Query & Sublinear Decomposition Structures
Strings, Automata & Information Retrieval
4.1
Tries, Exact String Matching & Multi-Pattern Automata
4.2
Suffix Structures, Sequence Alignment & Data Compression
Graph Theory, Shortest Paths & Network Flow
5.1
Graph Representations, Traversals, Connectivity & Topological Order
5.2
Disjoint Sets, Minimum Spanning Trees & Shortest Paths
5.3
Network Flow, Min-Cut & Bipartite Matching