How to find median using divide and concuer approach
Answers
Answered by
4
In the algorithm described on this page, if the list has an even number of elements, take the floor of the length of the list divided by 2 to find the index of the median. Use the median-of-median algorithm to recursively determine the median of the set of all the medians. Use this median as the pivot element, x.
Similar questions