Getting the most frequent items without counting every item

Posted by DeadMonkeyWalkin on Stack Overflow See other posts from Stack Overflow or by DeadMonkeyWalkin
Published on 2010-05-05T06:33:29Z Indexed on 2010/05/05 6:38 UTC
Read the original article Hit count: 271

Filed under:
|

Hi. I was wondering if there was an algorithm for counting "most frequent items" without having to keep a count of each item? For example, let's say I was a search engine and wanted to keep track of the 10 most popular searches. What I don't want to do is keep a counter of every query since there could be too many queries for me to count (and most them will be singletons). Is there a simple algorithm for this? Maybe something that is probabilistic? Thanks!

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about counting