News for hackers. Stuff that matters.
Re:Donald Knuth was framed by FabHK on Monday February 24, 2020 @03:46PM (#22408251)
Does anyone have any insight in the computational complexity of the two solutions?

The shell script sorts all the words (and then all the counts), so has complexity at least O(n log n) in the number of words.

It seems to me an optimal solution could be faster, and I wonder what Knuth implemented.

Re:Donald Knuth was framed by terminaljunkid on Wednesday February 26, 2020 @12:54AM (#22420661)
If you consider hash table insertion as O(1) then it is O(n) I guess.