GATE CS 2014, set 1 · Question 24 · Algorithms · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer
Let P be a quicksort program to sort numbers in ascending order using the first element as the pivot. Let t₁ and t₂ be the number of comparisons made by P for the inputs [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?
- (A) t₁ = 5
- (B) t₁ < t₂
- (C) t₁ > t₂
- (D) t₁ = t₂
Answer
Answer (C)
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