Question 150

Which sorting algorithm has a worst-case time complexity of O(n log n)?

  1. AInsertion sort
  2. BMerge sort
  3. CQuick sort
  4. DBubble sort
Show answerHide answer

Correct answer: (B) Merge sort

Explanation

Merge sort is O(n log n) in all cases; quick sort is O(n^2) in the worst case.

From DSSSB TGT Computer Science Full Mock Test 1

This is question 150 of DSSSB TGT Computer Science Full Mock Test 1. 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.