Question: Median Finding : Implement the following order statistics algorithms : a. Median of groups of 3,5 and 7. b. Randomized median finding algorithm. Make your

Median Finding :
Implement the following order statistics algorithms :
a. Median of groups of 3,5 and 7.
b. Randomized median finding algorithm.
Make your code generic enough so that it can answer order statistics for any k. For example, k = n/2 gives the median and k=n gives the max.
Quick sort :
Implement quicksort where the pivot is chosen from the previous order statistics algorithms. Compare the performance of quicksort with median as pivot with randomized quicksort which chooses a random element in the array as the pivot.

code in python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres Python code that implements the requested order statistics algorithms for finding the median o... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!