Time vs Space Complexity

Interactive Visualization — Compare Growth Rates

O(1)
Constant
O(log n)
Logarithmic
O(n)
Linear
O(n log n)
Linearithmic
O(n²)
Quadratic
O(2ⁿ)
Exponential
50
O(1)
O(log n)
O(n)
O(n log n)
O(n²)
O(2ⁿ)
Current n
0
O(1) ops
0
O(n) ops
0
O(n²) ops
0

Explanation

Press Animate to see how different complexity classes grow as input size increases. Use the Max n slider to control the range.
Ready. Select a visualization mode and press Animate.