GATE CS 2008 · Heap Sort & Non-Comparison Sorts

MCQ · 2 marks · Problem PROG-SORT-0048

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)\leq 2T (n/5)+n\)
  2. B
    \(T(n)\leq T (n/5)+T(4n/5)+n\)
  3. C
    \(T(n)\leq 2T (4n/5)+n\)
  4. D
    \(T(n)\leq 2T (n/2)+n\)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/455/gate2008-43

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com