If one computer can only hold 1 million numbers, how to find out the median number from 100 million numbers?
Reduce the problem to a more difficult one: sort the 100 million numbers using merge sort Then, take the 50 millionth element.
Hopefully, the real problem was "how do I do an external sort"? (If this is homework...I want to help in the right way. :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With