find the top K most frequent numbers in a data stream

Posted by Jin on Stack Overflow See other posts from Stack Overflow or by Jin
Published on 2013-06-30T04:16:22Z Indexed on 2013/06/30 4:21 UTC
Read the original article Hit count: 139

This is more of a data structure question rather than a coding question.

If I am fetching a data stream, i.e, I keep receiving float numbers once at a time, how should I keep track of the top K frequent numbers? Here my memory is 4G and I prefer to have less communication with hard drive unless necessary.

I think heap is good for updating the max and min. How should I design the data structure? Thanks

© Stack Overflow or respective owner

Related posts about data-structures

Related posts about data-stream