Quote:
Originally Posted by __Pat__ 
Let me clarify then.
Say you have a stream of characters called cs
You have a function that continuously loops, getting the characters from the stream.
In the function you can only use the cs, another single char in memory, which you would put the new cs in, overriding the old one, and one int counter to adjust as they want.

Let me clarify then.
Say you have a stream of characters called cs
You have a function that continuously loops, getting the characters from the stream.
In the function you can only use the cs, another single char in memory, which you would put the new cs in, overriding the old one, and one int counter to adjust as they want.
This may be a dumb question, but is cs infinite (at least seemingly) or do you know how many characters are going to come through the stream? I ask this because if cs never ends, how can you ever be sure if any character appears at least 51% of the time? If you know how many characters are going to be in the stream, you could write some pretty ugly and inefficient nested loops to figure out how many different characters there are and their percentage of occurrence.









