GATE | GATE-CS-2001 | Question 14
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: If all elements of the given array are same then that is the worst case for the randomised quicksort. And time complexity of worst case of quicksort is O(n²) that is proven already.
So, option (C) is correct.
Quiz of this Question
Please Login to comment...