Algorithms, one step at a time.

Every pattern runs as an animation next to the C++ that drives it. Step forward, step back, or run it on your own input.

Start with trees Space play · ← → step

Topics

2 live · more on the way

Trees

37 patterns

Traversals, views, bottom-up recursion, BSTs, serialization, heaps, segment trees and tries.

Graphs

20 patterns

BFS, DFS, cycles, topological sort, shortest paths, union-find, spanning trees, SCCs and bridges.

Sorting & searching

Coming soon

Insertion, merge, quick and heap sort, plus binary search and its many variants.

Linked lists

Coming soon

Reversal, fast and slow pointers, cycle detection, merging and reordering.

Dynamic programming

Coming soon

Grid paths, knapsack, subsequences and intervals, filled in one cell at a time.