ProgrammingModerate

Merge sort on n = 2^20 elements has what recursion depth?

  1. A. 19
  2. B. 21
  3. C. 1048576
  4. D. 20

Correct answer: D. 20

Each level halves the subarray, so the depth is log2(2^20) = 20.

More C Programming questions

Exams that ask this topic