Complexity Theory
Big-O Notation
How algorithms scale with input size n — the lens every engineer needs.
Growth Curves
Operations vs. input size n = 1..20 — y-axis capped at 30 for readability
O(1)
O(log n)
O(n)
O(n log n)
O(n²)
O(2ⁿ)
The Six Classes
O(1)
Constant
Fixed time regardless of input size. The gold standard — as close to instant as algorithms get.
Examples in AlgoFlow
O(log n)
Logarithmic
Halves the search space each step. Blazingly fast even on inputs with millions of elements.
Examples in AlgoFlow
O(n)
Linear
Grows directly with input size. Acceptable for most real-world workloads.
Examples in AlgoFlow
O(n log n)
Linearithmic
The theoretical lower bound for comparison sorts. Most efficient general-purpose sorts land here.
Examples in AlgoFlow
O(n²)
Quadratic
Nested iteration. Fine for small datasets — painfully slow beyond ~1,000 elements.
Examples in AlgoFlow
O(2ⁿ)
Exponential
Doubles with each additional element. Only practical for tiny inputs — think n < 20.
Examples in AlgoFlow
Click any algorithm name to open its interactive visualizer. → Full Cheat Sheet