A search engine finds answers among billions of pages in under a second. That takes more than a fast computer — it takes a smart algorithm: a step-by-step method for solving a problem. How big is the gap between a smart and a slow algorithm? Finding one name among a million: the slow way can take a million looks; the smart way never needs more than 20.
Your mission: start as a Shuffler. Race three sorting algorithms, crack a secret number with binary search, design the rules for a maze robot — then BE the algorithm: put mystery boxes in order from light to heavy using a balance scale and as few weighings as possible. Top rank: Big-O Master.
Three algorithms sort the same bars. Every comparison or move counts as one step. Who needs the fewest? Switch to nearly-sorted or reversed data — does the winner change? Click a lane to see how that algorithm works.
The computer runs each algorithm on the current kind of data at n = 8, 16, 32, 64 and 128 (random data: average of 3 runs) and counts the comparisons. Dashed lines are the formulas n(n−1)/2 and n·log₂n.
I’m thinking of a number. After each guess I say “higher” or “lower”. The smart move is to guess the middle of what’s left — that’s binary search. Then swap roles: you think of a number and the computer guesses.
Think of a whole number from 1 to 100 (keep it secret!) and answer honestly.
Drag the slider to pick the list size. Each grid line is 10× more. Assume a computer does 1 billion steps per second — how long do you wait?
Data: worst-case step counts calculated from the formulas — linear search n, binary search ⌈log₂(n+1)⌉, bubble sort n(n−1)/2 comparisons, merge sort about n·log₂n comparisons.
The robot can’t see the whole maze — it only feels the walls next to it. Each step it checks your rules from top to bottom and does the first one it can. Reorder them with ▲▼ and switch rules off with ⏻. Which order always escapes? Then compare with the shortest path found by breadth-first search.
Keep your right hand on the wall: turn right if you can, else go straight, else turn left, else turn around. In a maze without loops this always reaches the exit — but rarely by the shortest route.
Each box holds a different weight, but you can’t see it. Click two boxes to put them on the scale (1 comparison); press Swap to switch their places. Put the boxes in order from light (left) to heavy (right), then check. Fewer comparisons = more stars.
Pick the best answer and read the explanation.
Drag each item (or tap it, then tap a box) into the right group.
US standards: CSTA K-12 CS Standards (2017) 2-AP-10 (use flowcharts and/or pseudocode to address complex problems as algorithms), 2-AP-13 (decompose problems into parts); also 2-AP-17 (test with a range of cases — new data, new mazes). Georgia K-12 Computer Science Standards (grades 6–8): CSS.KC.6-8.18 (a problem can have multiple solutions), 19 (solve problems iteratively), 20.5 (implement a simple algorithm); CSS.CT.6-8.32.1 (decomposition, pattern recognition, algorithmic thinking, abstraction), 35.2 (Boolean operators to improve searches), 36.1–36.3 (algorithmic problem-solving of rising complexity). Codes as listed in GaDOE’s 6–8 CS framework (via CodeHS); check wording against the GaDOE document.
China’s curriculum: Compulsory Education Information Technology Curriculum Standard (2022), core strand “algorithms” (算法). Stage 3, grade 5 module “Algorithms around us” (身边的算法: describe algorithms in words and flowcharts, feel the difference in efficiency, e.g. searching and sorting); Stage 4 (grades 7–9) applies algorithms in programming projects. Textbook editions and lesson numbers vary.
Notes: in the race, “steps” = comparisons + moves (swaps or writes); bubble sort stops early when a pass makes no swaps; merge sort is the bottom-up version. The chart shows worst-case counts from formulas, not measured times; “1 billion steps per second” is only an assumption for comparison. The minimum worst-case comparisons for sorting 4, 5, 6 and 8 items (5, 7, 10, 16) are known results, written from the author’s knowledge.
Suggested use: start unplugged — students act out bubble and selection sort with playing cards and count steps. Use the guessing game to discuss why doubling the list adds only one guess. In the maze, have students find a rule order that always works and discuss “always works” vs “fastest”. After the main mission, ask students to explain their strategy and compare it with merge sort.