Skip to content
SimpleScope

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
Start: Linear search

Searching

Find a value. Learn to count work and to shrink the problem.

  1. Iterating 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.

  2. Binary search

    Open, best after Linear search

    Range 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.

  1. Swaps, invariant, O(n²)

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  2. Selection sort

    Open, best after Bubble sort

    Picking the minimum, comparing costs

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)

    after bubble sort

  3. Insertion sort

    Open, best after Selection sort

    Sorted prefix, best and worst case

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)

    after selection sort

  4. Merge sort

    Open, best after Binary search, Insertion sort

    Divide and conquer, recursion

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)

    after binary search, insertion sort

  5. Quick sort

    Open, best after Merge sort

    Partitioning, average vs worst case

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)

    after merge sort

  6. Heap sort

    Open, best after Selection sort

    Max-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

  7. Sorting without comparing; counts and prefix sums

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  8. Radix sort

    Open, best after Counting sort

    Digit 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.

  1. Graphs, queue, levels

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  2. Depth-first search

    Open, best after Breadth-first search

    Stack and recursion, deep exploration

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)

    after breadth-first search

  3. Dijkstra's algorithm

    Open, best after Breadth-first search

    Greedy, 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.

  1. Stack

    Ready

    Last in, first out; push, pop and underflow

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  2. Queue

    Ready

    First in, first out; enqueue, dequeue and the front

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  3. Ordered tree; insert, search and in-order walk; height

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  4. Min-heap in an array; sift-up, sift-down, priority queue

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  5. Nodes and links; insert at the head, walk, search and delete

    • See (not done)
    • Understand (not done)
    • Predict (not done)
    • Practice (not done)
  6. Hash table

    Open, best after Linked list

    Hash 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