Finding the median of an unsorted array
问题 To find the median of an unsorted array, we can make a min-heap in O(nlogn) time for n elements, and then we can extract one by one n/2 elements to get the median. But this approach would take O(nlogn) time. Can we do the same by some method in O(n) time? If we can, then please tell or suggest some method. 回答1: You can use the Median of Medians algorithm to find median of an unsorted array in linear time. 回答2: I have already upvoted the @dasblinkenlight answer since the Median of Medians