Asked • 04/28/19

Find median of unsorted array in $O(n)$ time?

To find the median of an unsorted array, we can make a min-heap in O(n log n) 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(n log n)time.Can we do the same by some method in O(n) time? If we can, then how?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.