GATE CS 2014 · Set-3 · Heap Sort & Non-Comparison Sorts

MCQ · 1 mark · Problem PROG-SORT-0036

You have an array of n elements. Suppose you implement quick sort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is
  1. A
    \(O(n^{2})\)
  2. B
    \(O(n logn)\)
  3. C
    \(\theta (n logn)\)
  4. D
    \(O(n^{3})\)

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

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2048/gate2014-3-14

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