Question: Suppose we have an array A = [ k , d , c , i , t , e , s , n , o

Suppose we have an array A=[k,d,c,i,t,e,s,n,o,p,j,u,x,a,q,y,l,b,g,m,h,r,v,f,w] which
includes 25 integers and we are trying to find the median of A. 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 A. Please use sub-
arrays of size 5. If the length of the array is not a multiple of 5, the last sub-array can be
incomplete. Note that you do not have to show work when sorting sub-arrays or ordering
the medians of sub-arrays.
(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 sub-arrays were of size 10?
 Suppose we have an array A=[k,d,c,i,t,e,s,n,o,p,j,u,x,a,q,y,l,b,g,m,h,r,v,f,w] which includes 25 integers and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!