Quicksort and Analysis
Consider the quicksort 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) Explain when we can expect a best-case partitioning.
(2) 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 rationale on how to solve). You do not need to prove the answer with the substitution method.