Algorithm Runtime Growth Calculator – Big O

Calculate algorithm execution time growth as input size increases for common Big O complexities.

About This Calculator

Calculate algorithm execution time growth as input size increases for common Big O complexities. Use the calculator above for instant results.

Worked Examples

Example 1: N=1000, base 10ms, O(n²)

  • 10 × (1000/100)² = 10 × 100 = 1,000 ms = 1 sec
  • Same algorithm at N=10,000 → 100 sec!

Answer: 1,000 ms (1 sec)

Example 2: N=1000, O(n log n)

  • ~133 ms | Sort algorithm grows slowly

Answer: ~133 ms

Example 3: N=50, O(2ⁿ) exponential

  • 2^50 operations — computationally infeasible

Answer: Computationally infeasible!

Who Uses This Calculator?

💻
CS Students

Understand algorithm scaling.

📊
Engineers

Choose right algorithm for data size.

🔧
Software Architects

Scale planning for growing datasets.

🏫
CS Teachers

Demo Big O complexity visually.

Common Mistakes to Avoid

❌ O(n²) may be fine for small N

A quadratic algorithm might run in milliseconds for N=100 but hours for N=100,000. Always estimate at your actual data size.

❌ Real performance depends on constants

O(n) with huge constant can be slower than O(n²) with tiny constant for small N. Big O is asymptotic, not absolute.

Frequently Asked Questions

Common algorithm complexities?

O(1): hash lookup. O(log n): binary search. O(n): linear search. O(n log n): merge sort, quicksort average. O(n²): bubble sort, nested loops. O(2ⁿ): brute force subset problems.

When does O(n²) become a problem?

N=1,000: milliseconds. N=10,000: seconds. N=100,000: minutes to hours. Plan algorithm choice based on expected data scale.

Reduce complexity?

Replace nested loops with hash maps. Use divide-and-conquer (O(n²) → O(n log n)). Precompute with memoization.