Vote for Big O Notation

I believe that the O(n) is correct. Before I saw JennBren’s post, I presumed that it was O(n log n) because I could not think of a possible way to have it as O(n). When I saw his comment, I saw the way that it could be calculated as O(n). Basically, you loop through the word once and put each letter into a separate section. At the end of the function, if any of the sections had more than one letter in them, then the word was not an isogram.

I am voting for O(n)

Hmmm… I was going to vote for O(n log n) too.

Privacy & Terms