Consider the Quicksort algorithm. Suppose there is a procedure for finding a…

PYQ GATE 2008

Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the elements. Let T(n) be the number of comparisons required to sort n elements. Then

  1. A.

    T(n) <= 2T(n/5) + n

  2. B.

    T(n) <= T(n/5) + T(4n/5) + n

  3. C.

    T(n) <= 2T(4n/5) + n

  4. D.

    T(n) <= 2T(n/2) + n

Attempted by 628 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…