Watch the code run.

Every topic is real code you can step through line by line, with a visualization that moves in lockstep. Scrub it, slow it down, feed it your own input — until the algorithm stops being memorized and starts being obvious.

step through sorting →

Topics

SortingBubble, insertion, selection, merge, quick — watch elements slide into place.5 algorithmsSearchingLinear, binary, lower bound — and the invariants that make binary search hard to get right.3 algorithmsLinked listsReverse in place, fast & slow runners, Floyd's cycle detection — arrows and all.3 algorithmsStacks & queuesNext greater, sliding window max, largest rectangle — the monotonic pattern.3 algorithmsTreesBST insert, search, in-order traversal — drawn as the tree grows and the walk descends.3 algorithmsGraphsBFS, DFS, Dijkstra — the frontier expands and distances settle on a live graph.3 algorithmsDynamic programmingMin-cost stairs, house robber, LIS — watch each subproblem's answer fill in.3 algorithms