How fast each Big-O class grows, timed on one input and one computer.
About this comparison
Seven rows, one per complexity class, each given the same 16 items. One computer runs every row at 32 simple steps a second, and the clock above is that computer's clock. Each bar fills to 100% of its own work, then turns green with its finishing time.
O(1) is 1 step, like reading one array slot. O(log n) is 4, the halvings from 16 down to 1 behind binary search. O(n) is 16, one look per item, as in linear search. O(n log n) is 64, the splits and merges of merge sort. O(n²) is 256, every item against every other, as in bubble sort.
Then the runaways. O(2ⁿ) is 65,536 steps, one per subset of the items. O(n!) is 20.9 trillion, one per order they can be put in, as a brute force route planner tries.
Only the growth. Every row runs at the same speed on the same input, so a row's time is its step count divided by 32. Double the items and O(n) takes twice as long, O(n²) four times as long, and O(2ⁿ) squares its time.
O(1) is done at 0.031 seconds, O(log n) at 0.125, O(n) at 0.5 and O(n log n) at 2. O(n²) finishes last of the five, at 8 seconds, its bar moving 12.5% a second. Meanwhile O(2ⁿ) stays under half a percent and O(n!) never visibly moves.
Then each runaway shows what it needs in all: O(2ⁿ) 34 minutes, O(n!) 20,700 years. The computer never changed between the rows; only the growth did.
On 16 items anything up to O(n²) is fine, and a real computer does billions of steps a second. Grow the input and the gaps open: at a million items, O(n²) is a million million steps, O(n log n) about 20 million.
So sort in O(n log n) once inputs reach the thousands, and read O(2ⁿ) or O(n!) as a sign to look for structure: dynamic programming, pruning, or a good enough greedy answer. Trying every subset or order only works for small n.