See how every algorithm actually works
83 interactive visualizers covering every core data structure and algorithm - from what an array is in memory to Manacher, segment trees and A*. Step through them one operation at a time, in either direction, with the code lighting up beside you.
- Visualizers
- 83
- Categories
- 12
- Editable inputs
- Every one
- Cost
- Free
Built to explain, not just to animate
An animation shows you what changed. Everything below exists to show you why.
Step backwards, not just forwards
Every algorithm compiles to an immutable list of frames, so rewinding is exact and free. Miss the moment a pivot settles? Scrub back to it. Most visualizers can only play forwards.
Code that lights up as it runs
The executing line is highlighted in step with the animation, so you see which line does the partitioning rather than just that partitioning happened. Real Python, JavaScript, Java and C++ sit alongside.
Your input, not a canned demo
Type your own array, drag graph nodes and connect them by tapping, paint a maze, change edge weights. The worst case is a button away - and so is your own failing test case.
Live cost, in context
Comparisons, swaps, reads, writes and recursion depth are counted as you watch, then shown against n, n log n and n² for your exact input. The numbers make the notation concrete.
One player for everything
The same transport, keyboard shortcuts and speed control drive all 83 visualizers. Learn the controls once; the effort goes into the algorithm instead of the interface.
Genuinely works on a phone
Not a shrunken desktop layout. The controls pin to the bottom of the viewport, editors take touch input, and every diagram is resolution-independent SVG.
Popular starting points
All visualizers
Foundations
What the machine actually does6 visualizersBefore any algorithm makes sense: how an array sits in memory, what a recursive call costs, and what the gap between n log n and n² feels like at scale rather than on paper.
Big-O complexity explorer
easyWatch the growth curves separate as n climbs.
Arrays and memory layout
easyWhy indexing is O(1) and inserting at the front is not.
O(n) insert/deleteOpenDynamic array and amortised growth
easyPush values and watch the capacity double.
O(1) amortisedOpenRecursion and the call stack
easyWatch fib(n) build an exponential tree, then memoise it away.
O(2ⁿ) naiveOpenTowers of Hanoi
mediumThree lines of recursion, 2ⁿ − 1 provably optimal moves.
O(2ⁿ)OpenBit manipulation playground
mediumSet, clear, toggle - and the two identities worth memorising.
O(1) per operationOpenSorting
Ten ways to put things in order10 visualizersThe classic showcase, and the fairest comparison in the module: every sort drives the same bar chart and counts comparisons and swaps identically, so the differences between them are the only thing left to see.
Bubble sort
easyRepeatedly swap neighbours until nothing moves.
O(n²)OpenSelection sort
easyFind the minimum, move it to the front, repeat.
O(n²)OpenInsertion sort
easyHow you sort a hand of cards.
O(n²)OpenShell sort
mediumInsertion sort that can move things a long way.
depends on the gapsOpenMerge sort
mediumSplit to single elements, then merge back in order.
O(n log n)OpenQuick sort
mediumPartition around a pivot, then recurse on both halves.
O(n log n)OpenHeap sort
mediumBuild a heap in the array, then extract the maximum n times.
O(n log n)OpenCounting sort
mediumSorting with zero comparisons.
O(n + k)OpenRadix sort
mediumSort by the last digit, then the next, and it comes out ordered.
O(d(n + b))OpenBucket sort
mediumScatter by value range, sort each bucket, concatenate.
O(n + n²/b + b)OpenSearching
Finding things without looking at everything7 visualizersLinear, binary and the family of variants built on it - including binary search on the answer, which is the technique interviewers actually test.
Linear search
easyCheck every position until you find it.
O(n)OpenBinary search
easyHalve the search space with every comparison.
O(log n)OpenLower and upper bound
mediumThe half-open variant that handles duplicates.
O(log n)OpenJump search
easySkip in blocks of √n, then scan backwards.
O(√n)OpenExponential search
mediumDouble the reach until you overshoot, then binary search.
O(log i)OpenInterpolation search
mediumGuess where the value should be, like using a phone book.
O(log log n)OpenBinary search on the answer
hardThe interview version: search a predicate, not an array.
O(log(range) × cost of the check)OpenLinear structures
Lists, stacks, queues and deques11 visualizersPointer-based structures where the arrows are drawn explicitly, because the arrows are the point. Includes the two that turn up constantly in interviews: the monotonic stack and the LRU cache.
Singly linked list
easyO(1) at the head, a walk for everything else.
O(n) searchOpenDoubly linked list
easyA back pointer buys O(1) deletion.
O(n) searchOpenCircular linked list
mediumThe tail points back at the head.
O(n) searchOpenReverse a linked list
mediumThree pointers, and the order of four lines is everything.
O(n)OpenFloyd's cycle detection
mediumTortoise and hare, in O(1) memory.
O(n)OpenStack
easyLast in, first out - and both ends are O(1).
O(1) push/pop/peekOpenQueue
easyFirst in, first out - and why list.pop(0) is a bug.
O(1) enqueue/dequeueOpenDeque
mediumA queue open at both ends.
O(1) at both endsOpenCircular queue (ring buffer)
mediumModulo turns a fixed array into an endless stream.
O(1)OpenMonotonic stack
hardNext greater element in one linear pass.
O(n)OpenLRU cache
hardA hash map and a doubly linked list, covering each other's weakness.
O(1) get and putOpenHashing
Collisions, probing and load factor3 visualizersWhat happens when two keys land in the same bucket, what happens when you refuse to allocate for that, and what happens when the table fills up.
Patterns and techniques
Turning O(n²) into O(n)7 visualizersTwo pointers, sliding windows, prefix sums, Kadane. Half a dozen loop shapes that between them solve a large fraction of every array question ever asked.
Two pointers
easyOne comparison eliminates a whole row of the brute force.
O(n)OpenFixed sliding window
easyTwo operations replace k additions.
O(n)OpenVariable sliding window
mediumGrow right, shrink left, never move backwards.
O(n)OpenPrefix sums
easyPrecompute once, answer every range query in O(1).
O(1) per queryOpenDifference array
mediumRange updates in O(1), materialised once at the end.
O(n + q)OpenKadane's algorithm
mediumOne decision, repeated n times.
O(n)OpenDutch national flag
mediumSort 0s, 1s and 2s in a single pass.
O(n)OpenTrees
From traversals to segment trees7 visualizersBalance is the theme: build a BST from sorted keys and watch it collapse into a linked list, then feed the same keys to an AVL tree and watch the rotations refuse to let that happen.
Tree traversals
easyPre, in, post and level order - recursive and iterative.
O(n)OpenBinary search tree
mediumInsert, search and the three cases of deletion.
O(log n)OpenAVL tree
hardFour rotation cases that refuse to let the tree lean.
O(log n)OpenBinary heap
mediumAn array pretending to be a tree.
O(log n)OpenTrie (prefix tree)
mediumThe path is the key.
O(length of the key)OpenSegment tree
hardRange queries and point updates, both O(log n).
O(log n) query and updateOpenFenwick tree (BIT)
hardPrefix sums in one array, driven by the lowest set bit.
O(log n)OpenGraphs
Traversal, shortest paths and spanning trees11 visualizersEvery graph here is editable - drag nodes, tap two of them to connect, tap a weight to change it. The interesting questions in this category are all 'what if', so the input has to be yours.
Adjacency list vs matrix
easyThe same graph, three ways, with very different costs.
O(V) matrix neighboursOpenBreadth-first search
easyExpands in rings, so it finds shortest paths.
O(V + E)OpenDepth-first search
easyA stack instead of a queue - that is the only difference.
O(V + E)OpenTopological sort
mediumKahn's algorithm, with cycle detection for free.
O(V + E)OpenDijkstra's algorithm
mediumSettle the closest unvisited node, then relax its edges.
O((V + E) log V)OpenBellman-Ford
mediumSlower than Dijkstra, but it survives negative weights.
O(V·E)OpenFloyd-Warshall
mediumAll pairs, three nested loops, one line of logic.
O(V³)OpenUnion-Find (disjoint set)
mediumPath compression and union by rank, together.
O(α(n)) ≈ O(1)OpenKruskal's algorithm
mediumCheapest edge first, skipping anything that closes a cycle.
O(E log E)OpenPrim's algorithm
mediumDijkstra with one line changed.
O(E log V)OpenA* and BFS pathfinding
mediumPaint a maze and watch three algorithms solve it differently.
O(E log V)OpenString algorithms
Pattern matching that does not backtrack5 visualizersWatch the naive matcher throw away a four-character partial match, then watch KMP refuse to. All five matchers share one visual, so the difference between them is impossible to miss.
Naive pattern search
easySlide one place right and start over.
O(n)OpenKMP pattern matching
hardThe text pointer never moves backwards.
O(n + m)OpenRabin-Karp
mediumA rolling hash, and why verification is not optional.
O(n + m)OpenZ-algorithm
hardHow far does the prefix repeat at every position?
O(n)OpenManacher's algorithm
hardLongest palindromic substring in O(n).
O(n)OpenBacktracking
Choose, explore, undo5 visualizersOne three-line skeleton, five very different problems. The N-Queens visualizer lets you switch pruning off and watch the node count explode, which is the entire lesson.
N-Queens
hardSwitch pruning off and watch the search explode.
O(n!)OpenSudoku solver
hardTry, recurse, undo - plus one ordering trick.
O(9^empty cells)OpenPermutations
mediumSwap in place, recurse, swap back.
O(n × n!)OpenSubsets (power set)
mediumOne binary decision per element - and a bitmask does the same job.
O(n × 2ⁿ)OpenRat in a maze
mediumWatch corridors light up and go dark again.
O(4^(rows×cols))OpenGreedy algorithms
When taking the best option works - and when it does not4 visualizersGreedy is easy to write and hard to justify. Each visualizer shows the greedy choice next to the near-miss that makes the proof necessary, including two cases where greedy is simply wrong.
Activity selection
easyEarliest finish time - and two plausible rules that fail.
O(n log n)OpenFractional knapsack
mediumDensest first, and split the last item.
O(n log n)OpenHuffman coding
hardMerge the two rarest symbols, repeatedly.
O(n log n)OpenCoin change: greedy vs optimal
easyGreedy works for real currencies and fails for made-up ones.
O(amount × coins) DPOpenDynamic programming
Seeing the table7 visualizersThe hard part of DP is never the code - it is seeing the table. Every cell draws an arrow to the cells it reads, and the traceback walks those arrows back to recover the actual answer.
Coin change (DP)
mediumOne subproblem per amount, and no first choice can trap it.
O(amount × coins)Open0/1 knapsack
mediumTake it or leave it, at every capacity.
O(n × W)OpenLongest common subsequence
mediumMatch means diagonal; mismatch means the better of two.
O(m × n)OpenEdit distance (Levenshtein)
mediumThree neighbours, three edits, one minimum.
O(m × n)OpenLongest increasing subsequence
mediumThe O(n²) table, and the O(n log n) trick that replaces it.
O(n²) DPOpenHouse robber
easyTwo choices per house, and the table collapses to two variables.
O(n)OpenUnique paths with obstacles
easyCounting problems reduce to a sum of two neighbours.
O(rows × cols)OpenPreparing for interviews rather than studying the mechanics? The system design, Python full-stack and AI/ML engineering modules cover the question-and-answer side.