Algorithms, for people who already code
Watch real algorithms run.
Every step is recorded from the actual JavaScript. Predict what happens next, then check yourself against the real run.
Free · No account needed · No AI · Classic textbook versions
Run Bubble sort
- Comparisons
- 0
- Writes
- 0
- Step
- 1/42
Array. index 0: 5; index 1: 3; index 2: 8; index 3: 1; index 4: 9; index 5: 2; index 6: 7.
Sort 7 numbers by swapping neighbors that are out of order.
Step 1/42comparisonwrite
A real recorded run
The path
19 lessons on searching, sorting, graphs and data structures, ordered so each one supports the next. The line is a recommendation: every station is open from the start. Each lesson has four layers: See, Understand, Predict, Practice.
- Level
- 1
- XP
- 0/ 100
- Streak
- 0days
- Layers
- 0/ 76
- Algorithms
- 0/ 19
Searching
Find a value. Learn to count work and to shrink the problem.
Linear search
Up nextIterating and comparing; how work is counted
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Linear search checks each element in turn until it finds the target or reaches the end.
Binary search
Open, best after Linear searchRange invariant, O(log n)
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after linear search
Sorting
Put things in order several different ways, and see why the cost differs.
Bubble sort
ReadySwaps, invariant, O(n²)
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Selection sort
Open, best after Bubble sortPicking the minimum, comparing costs
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after bubble sort
Insertion sort
Open, best after Selection sortSorted prefix, best and worst case
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after selection sort
Merge sort
Open, best after Binary search, Insertion sortDivide and conquer, recursion
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after binary search, insertion sort
Quick sort
Open, best after Merge sortPartitioning, average vs worst case
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after merge sort
Heap sort
Open, best after Selection sortMax-heap in the array, in-place O(n log n)
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after selection sort
Counting sort
ReadySorting without comparing; counts and prefix sums
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Radix sort
Open, best after Counting sortDigit by digit; why stability matters
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after counting sort
Graphs
Explore connected data with queues, stacks and priorities.
Breadth-first search
ReadyGraphs, queue, levels
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Depth-first search
Open, best after Breadth-first searchStack and recursion, deep exploration
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after breadth-first search
Dijkstra's algorithm
Open, best after Breadth-first searchGreedy, simple priority queue, shortest paths
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after breadth-first search
Data structures
Ways to keep data so the next operation is cheap, one operation at a time.
Stack
ReadyLast in, first out; push, pop and underflow
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Queue
ReadyFirst in, first out; enqueue, dequeue and the front
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Binary search tree
ReadyOrdered tree; insert, search and in-order walk; height
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Binary heap
ReadyMin-heap in an array; sift-up, sift-down, priority queue
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Linked list
ReadyNodes and links; insert at the head, walk, search and delete
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
Hash table
Open, best after Linked listHash function, buckets, chaining and collisions
- See (not done)
- Understand (not done)
- Predict (not done)
- Practice (not done)
after linked list
What the colors and shapes mean
One language in every lesson. Each state has its own shape as well as its color.
UntouchedNot looked at yet
CurrentThe position the algorithm is on
ComparingBeing compared right now
SwappedJust moved or exchanged
DoneIn its final place, or found
PivotThe reference value being used
In rangeInside the part being worked on
Ruled outCan no longer hold the answer
Go further
- Big-O notation explained
What O(1), O(log n) and O(n²) mean, and how fast the algorithms in the path grow.
- Compare algorithms
Side by side: complexity, stability, when to use each, and real operation counts.