Sorting questions

Q14

GATE CS 2014 CS-3Searching Sorting and HashingMCQ1 mark−1/3 if wrong
You have an array of nn 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
Show answer without attempting

Answer: A

Q14

GATE CS 2014 CS-1Searching Sorting and HashingMCQ1 mark−1/3 if wrong
Let PP be a quicksort program to sort numbers in ascending order using the first element as the pivot. Let t1t_1 and t2t_2 be the number of comparisons made by PP for the inputs [1  2  3  4  5][1\;2\;3\;4\;5] and [4  1  5  3  2][4\;1\;5\;3\;2] respectively. Which one of the following holds?
Show answer without attempting

Answer: C

0/20 correct0 marks

Related topics in Searching Sorting and Hashing