📊
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
- Predict. How many comparisons will this sorter make? Or which sorter is fastest here?
- Run. The bars move and a counter ticks up once for every comparison.
- Reveal. The real counts appear — you see for yourself which sorter won, and why.
- Race them. Run the same sorter on a tidy, a reversed, and a random list, and watch the count change.
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.