Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: need a faster median

by roboticus (Chancellor)
on Oct 18, 2011 at 17:31 UTC ( [id://932201]=note: print w/replies, xml ) Need Help??


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

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://932201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-24 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found