Some optimization tale

Stephan Diehl stephan.diehlNOSPAM at gmx.net
Mon Dec 29 11:08:39 EST 2003


Christos TZOTZIOY Georgiou wrote:

> On Sat, 27 Dec 2003 17:36:46 +0100, rumours say that Stephan Diehl
> <stephan.diehlNOSPAM at gmx.net> might have written:
> 
>>A while ago, I've posted a recipie about finding a common prefix to a list
>>of strings. While the recipie itself is quite bad (I have to admit) and I
>>didn't know at that time that this problem was solved already in the
>>os.path module.
>>The interesting part can be found in the commentaries, as this turned out
>>to be a quest for the most efficient algorithm to solve this particular
>>problem.
> 
> You might also want to read:
> 
> http://www.python.org/sf/681780

Terry's solution is much faster (at least on my test set) and, as an
additional benefit, is the easiest to understand.






More information about the Python-list mailing list