3 ms·
Again, you're assuming count has a bound size per word, which isn't true for an unbounded stream. Step 3 of your algorithm either requires unboundedness of cou
by SomeStupidPoint 10y ago
Again, you're assuming count has a bound size per word, which isn't true for an unbounded stream.
Step 3 of your algorithm either requires unboundedness of count (ie, count can use arbitrary amounts of memory) or can overflow on arbitrary length streams of words (and hence, has cases where it produces the wrong output).