← Max Learns

Max's Sorting Machine

Same list, five recipes, very different amounts of work

race five sorting algorithms on the same pile of bars, then try to beat them

ProgrammingLearnage 8+

what this teaches: sorting algorithms, algorithms as recipes, counting steps, why some code is faster

Play →

What you'll learn

How to play

  1. Pick an algorithm, slow the speed right down, and watch one step at a time.
  2. Read the recipe on the right — the line it is on lights up as it works.
  3. Switch to Race them, put two algorithms on the same list, and pick a winner.
  4. Try You sort it, and see if you can beat the machine's swap count.

FAQ

What age is this for?

Around 8 and up, roughly 3rd through 8th grade. Younger children enjoy the race and the you-sort-it puzzle long before the word algorithm means anything to them.

Do I need to know how to code?

No. There is no code on screen at all — each algorithm is written out as four plain-English steps, and you watch the bars follow them.

Are these the real algorithms?

Yes. Bubble, selection, insertion, merge and quick sort are all really running, one operation at a time, and the counters show exactly how many compares and moves each one used.

For parents and teachers

The moment worth waiting for is the race: bubble sort against quick sort on forty bars, where quick sort finishes while bubble sort is still in its first third. That gap is the whole reason computer scientists care which algorithm you choose, and a child who has watched it once never needs the idea explained again. Pairs well with sorting a real deck of cards by hand afterwards.

← back to Max Learns