Which sorting algorithm has a worst-case time complexity of O(n log n)?
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.
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.
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.