GATE IT 2004 · Heap Sort & Non-Comparison Sorts

MCQ · 1 mark · Problem PROG-SORT-0054

Consider a list of recursive algorithms and a list of recurrence relations as shown below. Each recurrence relation corresponds to exactly one algorithm and is used to derive the time complexity of the algorithm.\[\begin{array}{|l|l|l|l|}\hline \text{} & \textbf{Recursive Algorithm } & \text{} & \textbf{Recurrence Relation} \\\hline \text{P} & \text{Binary search} & \text{l.} & \text{$T(n) = T(n-k) +T(k) +cn$} \\\hline \text{Q.} & \text{Merge sort} &\text{ll.} & \text{$T(n) = 2T(n-1) + 1$ }\\\hline\text{R.} & \text{Quick sort}& \text{lll.} & \text{$T(n) = 2T(n/2) + cn$}\\\hline \text{S.} & \text{Tower of Hanoi} & \text{lV.} & \text{$T(n) = T(n/2) + 1$} \\\hline \end{array}\]Which of the following is the correct match between the algorithms and their recurrence relations?
  1. A
    P-II, Q-III, R-IV, S-I
  2. B
    P-IV, Q-III, R-I, S-II
  3. C
    P-III, Q-II, R-IV, S-I
  4. D
    P-IV, Q-II, R-I, S-III

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/3700/gate2004-it-57

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