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

You have an array of n elements. Suppose you implement quicksort 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. (B) O(n log n)
  3. (C) Θ(n log n)
  4. (D) O(n³)
Answer

Answer (A)

Answer from the official GATE CS 2014 answer key.

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