GATE CS 1996 · Heap Sort & Non-Comparison Sorts

MCQ · 1 mark · Problem PROG-SORT-0060

Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot (i). \(1, 2, 3, \dots n\)(ii). \(n, n-1, n-2, \dots, 2, 1\)Let \(C_1\) and \(C_2\) be the number of comparisons made for the inputs (i) and (ii) respectively. Then,
  1. A
    \(C_1 \lt C_2\)
  2. B
    \(C_1 = C_2\)
  3. C
    \(C_1 \gt C_2\)
  4. D
    we cannot say anything for arbitrary 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/2744/gate1996-2-15

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