Possible Duplicate:
Finding the max repeated element in an array
If there is a word stream, with one word having an occurrence rate of 51% or more, how can we find the most frequent word if only string, and an int can be stored in the memory at a time to help us find it.
We can only access each word a single time, since this is a stream.
No specific language is necessary, but this is mainly intended with Java in mind.
Also I'm not asking for code, just the idea. :)