GATE | GATE-CS-2015 (Set 1) | Question 12
Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n(≥ 2) numbers? In the recurrence equations given in the options below, c is a constant.
T(n) = 2T (n/2) + cn
T(n) = T(n – 1) + T(0) + cn
T(n) = 2T (n – 2) + cn
T(n) = T(n/2) + cn
In the worst case, the chosen pivot is always placed at a corner position and recursive call is made for the following:
a) For subarray on left of pivot which is of size n -1 in worst case.
b) For subarray on right of pivot which is of size 0 in worst case.
Quiz of this Question
Please comment below if you find anything wrong in the above post
My Personal Notes arrow_drop_up
Please Login to comment...