Finding median of large set of numbers too big to fit into memory?

Have a look at the "Median of Medians" algorithm in this wikipedia article Related question: Median-of-medians in Java Explanation: ics.uci.edu/~eppstein/161/960130.html.

Have a look at the "Median of Medians" algorithm in this wikipedia article. Related question: Median-of-medians in Java. Explanation: ics.uci.edu/~eppstein/161/960130.html.

– garsh0p Oct 8 '10 at 6:06 Good question.Probably. You could of course also process each table 5 (or 7, ..) rows at a time... But then I suppose you may be violating the memory constraints. – aioobe Oct 8 '10 at 6:13 @aioobe, the number set is too large to fit into the memory, so even if we can find the median of medians, how can we do the quick select?

– Alcott Oct 11 at 2:25.

For the median of medians you still need to do pivoting. It is an in memory approach. In this case you need to use a streaming approach.In the first pass you find max and min of the sample.

Call that U and L for upper an lower bounds. Then set a candidate median at the average of U and L. With a second pass you count the probability of X Essentially it's binary search among possible medians.

If you can afford additional disk space, you can at each step filter all the elements between U and L and work only on those going forward, since the median is guaranteed to be included. This brings the complexity down to linear time, just as that of pivoting.

For the median of medians you still need to do pivoting. It is an in memory approach. In this case you need to use a streaming approach.

In the first pass you find max and min of the sample.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions