Question: Rewrite the quicksort partition function so that the pivot is chosen by selecting the median of three random values from the array. Next write a
Rewrite the quicksort partition function so that the pivot is chosen by selecting the median of three random values from the array. Next write a version using five random values. This may reduce the running time. Test both of these versions with sorted arrays, random arrays, and reverse order arrays, and display your results.
Step by Step Solution
3.43 Rating (156 Votes )
There are 3 Steps involved in it
The question is complete To tackle this question well need to reimplement the partition function used in quicksort to select a pivot based on the median of a set of random values rather than the conve... View full answer
Get step-by-step solutions from verified subject matter experts
