The method quicksort uses the method choosePivot to choose a pivot and place it into the first array location. Implement choosePivot in two ways:
a. Always choose the first item in the array as pivot.
b. Choose a pivot as Exercise describes.
Add a counter to the method partition that counts the number of comparisons that are made. Run quicksort with each pivot selection strategy and with arrays of various sizes. On what size array does the difference in the number of comparisons become significant? For which pivot selection strategy does the difference in the number of comparisons become significant?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.