📊

SortTales

Five ways to sort a list — and a surprise: the fastest one depends on the list.

🔮 Open the sorting console →

What "fast" really means for a sorter

Every sorting algorithm does one basic move over and over: it compares two items and decides which comes first. The number of comparisons it makes is how much work it does — and here is the surprise: the same sorter does more or less work depending on the list. A simple sorter can beat a clever one when the list is already almost tidy. That feeling — how work grows with the list — is what computer scientists call Big-O.

  1. Predict. How many comparisons will this sorter make? Or which sorter is fastest here?
  2. Run. The bars move and a counter ticks up once for every comparison.
  3. Reveal. The real counts appear — you see for yourself which sorter won, and why.
  4. Race them. Run the same sorter on a tidy, a reversed, and a random list, and watch the count change.

Everything runs on your device — no internet, no accounts. These are real (tiny) sorting algorithms, the exact kind inside every program that puts things in order.

Meet the crew — the five sorters

  • Bubbly runs Bubble sort — compares each pair of neighbours and swaps the ones out of order, bubbling the biggest to the end. Fast when the list is nearly tidy; slow when it is a mess.
  • Inserta runs Insertion sort — builds the sorted list one item at a time, slipping each new item into its place. Great on almost-sorted lists.
  • Scanna runs Selection sort — scans the whole rest of the list every time to pick the smallest. She never notices the list is already sorted — she always does the same amount of work.
  • Quicka runs Quick sort — picks a pivot and splits the list into "smaller" and "bigger", then repeats on each half. Usually quick — hence the name.
  • Merga runs Merge sort — keeps splitting the list in half until each piece is one item, then merges the pieces back in order. Stays fast even on big, messy lists.

Painted friends + storybooks are coming soon.