What is Sorting?
Sorting means arranging numbers in order (smallest → largest). Think of it like arranging books on a shelf by height. The coloured bars below represent numbers — watch how each algorithm rearranges them!
Current algorithm: Bubble Sort: Repeatedly compare neighbours and swap if out of order. Simple but slow — like sorting a hand of cards by swapping adjacent ones.
Starting Bubble Sort: repeatedly compare adjacent pairs and swap if out of order.
Big O — How Fast Does It Grow?
n = 12 barsThe O(n²) curve grows much faster than O(n log n). For 30 numbers, O(n²) does ~900 operations; O(n log n) does only ~148. The highlighted dot shows where n=12sits on the active algorithm's curve.