Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 subarrays 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started