Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2001 | Question 14

  • Last Updated : 28 Jun, 2021

Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort?
(A) O(n)
(B) O(n Log n)
(C) O(n2)
(D) O(n!)


Answer: (C)

Explanation: Randomized quicksort has expected time complexity as O(nLogn), but worst case time complexity remains same. In worst case the randomized function can pick the index of corner element every time.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :