📈 Big O Notation

See how different time complexities scale. Drag the slider to increase input size and watch some algorithms explode while others stay calm.

Designed with the WJEC specification in mind
CS A-level Unit 3
⚙️

Select complexities to compare

5
📊

Growth Chart

The chart clips very large values at its top edge. Use the table for their values. Functions illustrate growth; they are not exact operation counts for every algorithm.

🔢

Operations at n = 5

ComplexityOperationsIf 1μs eachVerdict
💡

Real Algorithm Examples

AlgorithmWhat it's likeComplexity
Array accessOpening a book to page 42 - you go straight thereO(1) - instant
Binary SearchGuessing a number - "higher or lower?" halves the options each timeO(log n) - very fast
Linear SearchLooking for your name in an unsorted list - check every single oneO(n) - depends on size
Merge SortSplit in half, sort each half, merge back togetherO(n log n) - fast
Bubble SortSorting cards by swapping neighbours - very slow on big listsO(n²) - slow
Fibonacci (naive)Recalculates the same thing over and over - doubles the work each stepO(2ⁿ) - impossibly slow
💡 Helpful hint - what does "log" mean?
log n is the number of times you can halve n before you reach 1.
For example: log₂(8) = 3, because 8 → 4 → 2 → 1 (halved 3 times).
log₂(1000) ≈ 10 - so even with 1,000 items, you only need about 10 steps!
That's why O(log n) is so fast - and why binary search beats linear search on large lists.