GATE CS 2015 · Set-1 · Heap Sort & Non-Comparison Sorts

MCQ · 1 mark · Problem PROG-SORT-0034

Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n ( \(\geq\)2) numbers? In the recurrence equations given in the options below, c is a constant.
  1. A
    T(n)=2T(n/2)+cn
  2. B
    T(n)=T(n-1)+T(1)+cn
  3. C
    T(n)=2T(n-1)+cn
  4. D
    T(n)=T(n/2)+cn

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/8017/gate2015-1-4

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