in reply to Re^2: An efficient way to gather a common portion of several strings' beginnings
in thread An efficient way to gather a common portion of several strings' beginnings
Speaking of algorithmic efficiency. Consider the case where $string17 eq "x" and preceding values all span kilobytes. Clearly, there's some room for improvement.
Hm. You could sort the strings, but sorting is O(n log n) instead of O(n).
Still think so?
|
|---|