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