Question 178Asked in DSSSB TGT Computer Science, 25 Jun 2023, Shift 2 (12:30 PM)

What is the average case time complexity of merge sort?

  1. AO(n log n)
  2. BO(n)
  3. CO(1)
  4. DO(n² log n)
Show answerHide answer

Correct answer: (A) O(n log n)

Explanation

Merge sort always halves the array (log n levels) and does O(n) merging work at each level. So its best, average and worst case are all O(n log n).

From DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 2 (12:30 PM)

This is question 178 of DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 2 (12:30 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.