Big O Growth Comparison Calculator
Work out big o growth comparison instantly with clear inputs, formula shown and shareable results.
About Big O Growth Comparison Calculator
Big-O describes how work scales with input size. Comparing two classes at a concrete n shows the practical gap: the ordering 1 < log n < n < n log n < n² < n³ < 2ⁿ holds for all sufficiently large n.
Formula
Growth ordering
O(1) ⊂ O(log n) ⊂ O(n) ⊂ O(n log n) ⊂ O(n²) ⊂ O(n³) ⊂ O(2ⁿ)
Worked example
With the default values below, Big O Growth Comparison Calculator returns Second ÷ first of 100.343332. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Input size naccepts 1–1,000,000
- 1,000
- First complexityone of O(1), O(log n), O(n), O(n log n), O(n²), O(n³), O(2ⁿ)
- O(n log n)
- Second complexityone of O(1), O(log n), O(n), O(n log n), O(n²), O(n³), O(2ⁿ)
- O(n²)
Results
- Second ÷ first
- 100.343332
- Operation count for the first
- 9,965.78
- Operation count for the second
- 1,000,000.00
- Which grows more slowly
- The first complexity is faster
Step by step
- 1Values used
- 2Growth ordering
- 3Second ÷ first= 100.343332
- 4Operation count for the first= 9,965.78
- 5Operation count for the second= 1,000,000.00
- 6Which grows more slowly= The first complexity is faster
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
n log n versus n² at n = 1000?
About 9966 against 1000000 — the quadratic algorithm does roughly 100 times more work.
Do constants matter?
Big-O ignores them, but in practice a large constant can make an asymptotically better algorithm slower for small inputs.
Related Calculators
You might also need
- Discrete Logarithm CalculatorAlso in Discrete Math, Logic & Number Theory
- Adjacency Matrix CalculatorAlso in Discrete Math, Logic & Number Theory
- Base 64 Value CalculatorAlso in Discrete Math, Logic & Number Theory
- Bell Number CalculatorAlso in Discrete Math, Logic & Number Theory
- Binary To Decimal CalculatorAlso in Discrete Math, Logic & Number Theory
- Binary To Hexadecimal CalculatorAlso in Discrete Math, Logic & Number Theory
