What's happening?
- Pick an input size and every contestant runs on it at once.
- Counts are calculated exactly; the track uses a logarithmic scale so O(1) and O(2ⁿ) fit on one screen.
- The time column assumes a billion simple operations per second — roughly one CPU core.
Complexity
- Time
- Compares O(1) · O(log n) · O(n) · O(n log n) · O(n²) · O(2ⁿ)
- Space
- —
Where you'll meet it
Choosing between a nested loop and a HashMap, or a sort and a scan, is a Big-O decision — it decides whether a feature works at 10 users or 10 million.
Common mistake
Thinking O(n²) is "a bit slower" than O(n log n). At n = 100,000 it is about 6,000 times more work.
FAQ
What does O(n log n) mean?
The work grows a little faster than the input — like sorting with merge sort.
Is O(1) always fastest?
It does not grow with n, but its constant can still be large; Big-O describes growth, not exact speed.
Why is O(2ⁿ) so bad?
Each extra input doubles the work: n = 60 is already about 10¹⁸ operations.