ALGOHAY

📈 Big O Complexity Analyzer

Pick the growth classes you want to compare, set an input size, and see their operation counts ranked from slowest- to fastest-growing — then pit any two complexities against each other to see which dominates.

📊 Compare Growth Classes

Operation counts are representative (e.g. n² = n·n), for comparing growth — not exact instruction counts.

📈 Growth at n = 16 (slowest-growing first)

RankComplexityClassOperations
1O(1)Constant1
2O(log n)Logarithmic4
3O(n)Linear16
4O(n log n)Linearithmic64
5O(n²)Quadratic256

⚔️ Which complexity dominates?

Asymptotic verdict
O(n²) dominates — it grows faster for large n, so it is the more expensive term.

What is a Big O Complexity Analyzer?

It is a side-by-side calculator for the growth functions behind Big O notation. Choose any mix of the canonical classes — constant, logarithmic, linear, linearithmic, quadratic, cubic, exponential, and factorial — and the analyzer evaluates each one at your chosen input size and ranks them by cost, making the dramatic gap between, say, O(n log n) and O(2ⁿ) impossible to miss.

Use it to build intuition for why an algorithm that is fine on a hundred items falls over on a million, to sanity-check the complexity you claimed in an interview, or to settle which of two candidate approaches will scale. The dominance check reports the asymptotic winner between any two classes so you know which term controls the running time as n grows large.

❓ Frequently Asked Questions

What does Big O notation actually measure?

Big O describes how an algorithm's running time or memory grows as the input size n grows, ignoring constant factors and lower-order terms. It captures the shape of the growth — linear, quadratic, logarithmic — rather than a wall-clock time, so you can reason about scalability independent of hardware.

Why does O(n log n) beat O(n²) even when n is small?

Asymptotically it always wins for large enough n, but for small n the constant factors can flip the ranking — an O(n²) algorithm with a tiny constant can beat an O(n log n) one until n grows past a crossover point. This tool shows representative operation counts at a specific n so you can see where each curve sits, while the dominance check reports the true asymptotic winner.

Are the operation counts exact?

No — they are representative values from each growth function (for example n² is computed as n·n and n log n uses log base 2). They are meant for comparing the shape and relative cost of growth classes, not for predicting exact CPU instructions, which depend on constants the notation deliberately hides.

What is the difference between O, Θ, and Ω?

Big O is an upper bound (grows no faster than), Ω is a lower bound (grows at least as fast as), and Θ is a tight bound (both). In everyday interview usage people say Big O but usually mean the tight bound. This analyzer compares growth classes, which correspond to the tight Θ behaviour of each function.