Question: 2. [Random Pivot Selection - 30 Pts] In the algorithm SELECT that we have discussed in chapter 9, input elements are divided into groups of
![2. [Random Pivot Selection - 30 Pts] In the algorithm SELECT](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f951ad26210_40466f951acc096e.jpg)
2. [Random Pivot Selection - 30 Pts] In the algorithm SELECT that we have discussed in chapter 9, input elements are divided into groups of 5. a) Will the algorithm works if they are divided into groups of 7? Prove your claim by arriving at the running time similar to the recurrence we got for group size 5 during the lecture b)Show that SELECT does not run in linear time if groups of 3 are used 3. [Random Pivot and Quick Sort-15 Pts] Show that quick sort can be made to run O(n log n)time in the worst-case. Assume that all elements are distinct. a) Write your algorithm that run quick sort can be made to run O(n log n)time b) Write the recurrence that shows the running time of your algorithm in (a) above c) Briefly explain (no need to prove) how your recurrence records O(n log n)time in worst-case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
