Algorithms and Data Structures · Junior · Question 5 of 75
Which complexity grows the slowest as n increases?
- 1O(n)
- ✓Correct answer: O(log n)
- 3O(n log n)
Explanation
Logarithmic growth is very slow: doubling n adds just one step. For a million elements log₂ n is about 20. O(n) and O(n log n) grow much faster.