Big-O Complexity Explorer
See how algorithm complexity classes grow as input size N increases.
When growth outruns tuning 🖖
Big-O describes how work grows as input size increases. A single loop grows roughly with N, nested loops often grow with N^2, and branching recursion can grow exponentially. The important lesson is scale: at small N many approaches look similar, but at larger N the growth class dominates runtime.
Reading the doubling test 🖖
The clearest way to feel a growth class is to double the input and watch the work. Under O(log N) the effort barely moves ā binary search finds one item among a million in about 20 comparisons. Under O(N) the work doubles, and under O(N2) it quadruples. Slide N in this tool and watch the gaps widen from invisible to overwhelming.
When a faster class loses 🖖
A lower growth class does not guarantee a faster program. Computer scientists call the exceptions galactic algorithms: methods with a superior Big-O whose hidden constant factor is so enormous they only overtake simpler methods on inputs bigger than anything in the physical universe. Several record-holding matrix-multiplication algorithms are never run in practice for exactly this reason ā Big-O quietly drops the constants that decide real-world speed.
Example problems
- Small N=20 - All curves at N=20
- N=1000 - N=1000: polynomial curves diverge
- Log scale - Log scale reveals growth differences
- Crossover - Crossover point where O(N²) overtakes O(N log N)