Gate CS-2014-1 Question Paper With Solutions

Q. 24 Let P be a QuickSort Program to sort numbers in ascending order using the first element as pivot. Let t1 and t2 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) t1 = 5

(B) t1 < t2

(C) t1 > t2

(D) t1 = t2

Answer: (C)

Explanation:

Gate CS-2014-1 Question Paper With Solutions

Learn More:   Gate ME-2016-1 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here