User talk:Sartak

Hi, I just read your speed comparision of [perl vs C++]. Have you tried using a hash map? It's a bit unfair to compare different langauges with respect to hashing vs a sorted map, because the sorted map is asympotically slower.

Regarding that problem, if you hash the strings yourself, you can hash each substring in O(1) time. For example, when hashing the substrings of "abcde". Let's say you have hashed "abc", then to hash "abcd", you have stored hash("abc") which you combine with "d" in some reasonably smart fashion to compute hash("abcd"), which should give you a solution that runs in time.

Don't feel bad about not getting through the art of computer programming, I can't either :(. --Rrenaud 15:59, 4 Feb 2006 (EST)