Question: Let S be a (not necessarily sorted) sequence of n different integers. An integer x in S is called as approximate median of S if
Let S be a (not necessarily sorted) sequence of n different integers. An integer x in S is called as approximate median of S if |{y ? S: y < x}| ? n/4 and |{y ? S: y > x}| ? n/4 . Design an O(n) time algorithm to find all the approximate medians of S
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
