Skip to main contentSkip to solution

Complexity Analysis of algorithms is performed to explain how an algorithm will perform when the input _______________.

Solution

✅ Correct Option: 2

Complexity analysis studies how the time (or space) an algorithm needs grows as the input size nn grows. This is why it is written in asymptotic notation such as O(n)O(n) or O(nlog⁡n)O(n \log n).


Options 3 and 4: whether the input is sorted affects the best-case or worst-case behaviour of a particular algorithm, but it is not what complexity analysis is about. The analysis is about input size.

Option 1: if the input never changes, there is no growth rate to study.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question