GATE CS 2015, set 1 · Question 14 · Algorithms · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n (≥ 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
Answer

Answer (B)

Answer from the official GATE CS 2015 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes