Number of distinct substrings of a string [continuation]

n00m n00m at narod.ru
Sun Nov 29 11:00:38 EST 2009


Tested both my codes against
a random string of length = 10000.

===========================================

from random import choice
s = ''
for i in xrange(10000):
    s += choice(('a','b','c','d','e','f'))

===========================================

C++: ~0.28s
Python: ~0.48s

PS
I suspect that building of Suffix Tree would
be a big exec.time-consuming overhead



More information about the Python-list mailing list