If he needs his output sorted though? Certainly the built-in sort won't be slower than using some external sort later?
Then again, the n in sort's O(n) is the number of word forms which doesn't increase linearly with corpus size. Some law for it can probably be derived from Zipf's Law, I suspect it's something like log(corpus_size). So the sort should take an average of log(n)*log(log(n)) over corpus size which is not that bad.
In reply to Re^2: Rewrite Program Using Arrays
by mbethke
in thread Rewrite Program Using Arrays
by perl.j
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |