1. (25 points) Quicksort and Analysis
Consider the quick sort algorithm in our textbook as shown below
QUICKSORT(A, p,r)
1 if p < r
2 q = PARTITION(A, p,r)
3 QUICKSORT(A, p, q - 1)
4 QUICKSORT(A, q + 1, r)
(1) (10 points) Explain when we can expect a best-case partitioning.
(2) (15 points) Assume that the algorithm always produces a best-case partitioning discussed
above, provide a tight bound on the running time of quicksort in this case. Show your answer
(a) in recurrence and (b) solve the recurrence (show your rational how to solve). You do not
need to prove the answer with the substitution method.