Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Rewrite Program Using Arraysby mbethke (Hermit) |
on Mar 25, 2012 at 17:51 UTC ( [id://961513]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|