Algorithms

Big-O Growth Rates

Plot the common complexity classes on the same axes. See why O(n log n) is practical and O(2ⁿ) is not.

4 minLevel 1/3The interactive stage stays ad-free.
Max n20Classes6Scale400
O(1)O(log n)O(n)O(n log n)O(n²)O(2ⁿ)

Constants are ignored in Big-O, but they matter in practice. For small inputs a simple quadratic loop can beat a complicated linearithmic algorithm. At scale, the asymptotic difference dominates.

What you are seeing

1

Big-O describes an upper bound on growth as input size grows, ignoring constants and lower-order terms.

2

Logarithmic growth barely rises; linear grows steadily; quadratic bends upward; exponential explodes.

3

A lower asymptotic class is usually the better algorithm, but constants and input size still matter.

Why it matters

Big-O is how engineers reason about scalability before running a benchmark. It predicts what happens when data grows 10× or 100×.

Complexity & details

This page compares O(1), O(log n), O(n), O(n log n), O(n²), and O(2ⁿ).

Frequently asked questions

Why can an O(n²) algorithm beat O(n log n)?+

Asymptotics ignore constants. For small n, a simple O(n²) loop with good cache behavior can outperform a complicated O(n log n) algorithm.

What is the difference between Big-O, Big-Ω, and Big-Θ?+

Big-O is an upper bound, Big-Ω is a lower bound, and Big-Θ is a tight bound that is both.