Question 147

The worst-case time complexity of Quick Sort is:

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

Correct answer: (B) O(n^2)

Explanation

Occurs when pivots are always the smallest or largest element.

From DSSSB TGT Computer Science Full Mock Test 2

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