Question: Suppose we have an array A = [ k , d , c , i , t , e , s , n , o
Suppose we have an array which
includes integers and we are trying to find the median of You can assume that variables
that are lexicographically greater have greater values.
a Utilize the median of medians algorithm to find the "true" median of Please use sub
arrays of size If the length of the array is not a multiple of the last subarray can be
incomplete. Note that you do not have to show work when sorting subarrays or ordering
the medians of subarrays.
b In the first iteration, what values are guaranteed to be less than the median of medians?
What values are guaranteed to be greater than the median of medians?
c What would be the time complexity of this algorithm if our subarrays were of size
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
