@divya

This is a widely known issue and lot of work has been done on it. See
http://www.americanscientist.org/issues/pub/the-britney-spears-problem/1
for a discussion on this and more.

On Jul 3, 10:03 am, divya <sweetdivya....@gmail.com> wrote:
> You are provided with a stream of integers, design a data structure to
> store the number of occurrences of each integer.
>
> If the set of integers is known, then the problem becomes simple.
>
> If the set of integers is known:
> Have a hash of the known set of integers. Parse the input stream, hash
> it to get the key and increase its corresponding value.
>
> how to do efficiently if the set is not known?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to