Exercises
Quicksort

  1. Assuming that the split function pivots around the first element in the subarray,

  2. If all the elements in the subarray A are the same, state the value of index splitPt after the first call to split(A, first, last, splitPt)

  3. Briefly explain why the running time of function split(..) is linear.

  4. How would you modify the quicksort function to sort in descending order?


Continue to:  Unit 3 / Prev / Next