Algorithms, animated

Learn algorithms by watching them run.

52 step-by-step animations show exactly what the code does: every comparison, swap, recursive call and proof step. Then change the input and watch it again.

No sign-up. Works on your phone.

Analysis of Algorithms

Pick a topic and press play

T(n)

Counting steps

How much work does code do? Count every line, add it up into T(n), and find the Big-O.

All 12 animations →
O(n)

Growth rates and Big-O

Big-O, Big-Ω and Big-Θ, proved with c and n₀ and drawn on a graph.

All 6 animations →
lim

Limits and loop invariants

Compare growth with limits, and prove loops correct with invariants.

All 3 animations →
⇅

Sorting

Watch the classic sorts swap, shift and settle, with the code running alongside.

All 3 animations →
f(n−1)

Recursion

How recursive calls run on the call stack, and how to write their recurrences.

All 4 animations →
T(n/2)

Solving recurrences

Four methods: iteration, substitution, recursion trees and the Master Theorem.

All 13 animations →
BST

Binary search trees

Insert, search, delete, min, max, successor, predecessor and traversals. Build your own tree.

All 11 animations →
{ }

Analyse your own code

Paste any C function. Prof. Bolts runs it, counts every line, and works out T(n) and the Big-O as an animation.

Try it →
Available now

Analysis of Algorithms

52 animations from counting steps to recurrences, the Master Theorem and binary search trees.

Browse all animations →
Coming next

Data Structures

Linked lists, stacks, queues, heaps, hashing and more, animated the same way.

Meet Prof. Bolts

A robot that shows every step

Prof. Bolts works through each idea in front of you, points at the line that is running and writes the working on the board. Every animation is built around the step students usually get stuck on. Prefer reading? There are short notes for some topics too. About Prof. Bolts.