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
Algorithm:
All Growth Curves
Time-Space Trade-off Demo
O(n) vs O(n²) Live Race
Max n:
50
Animate
Reset
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.