Let \(P\) be a quicksort program to sort numbers in ascending order. Let…
PYQ GATE 1987Modified — slightly modified from the official paper; see the solution
Let be a quicksort program to sort numbers in ascending order. Let and be the time taken by the program for the inputs and , respectively. Which of the following holds? Assume each partition chooses the first element as pivot, compares it once with each other element in that partition, and that time is measured by this comparison count.
- A.
- B.
- C.
- D.
Attempted by 84 students.
Sign up free to check your answer
Sign up freeLoading lesson…

