Rewrite the quicksort partition function so that the pivot is chosen by selecting the median of three
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Operating Systems Internals and Design Principles
ISBN: 978-0133805918
8th edition
Authors: William Stallings
Posted Date: