in reply to Re: need a faster median
in thread need a faster median

I have a non-sorted array of "floats" of size 10M+. I have no more assumptions.

Replies are listed 'Best First'.
Re^3: need a faster median
by roboticus (Chancellor) on Oct 18, 2011 at 17:31 UTC

    I found that on my laptop, I can find the mode of 10 million floats in 13 seconds. Just keep a count of each value encountered and select the largest value. There's no need to sort it.

    Update: I forgot to mention that a hash is a good place to keep your counts...

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.