Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Finding longest palindrome from a string

by BrowserUk (Pope)
on Aug 13, 2004 at 21:38 UTC ( #382854=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Finding longest palindrome from a string
in thread Finding longest palindrome from a string

Unfortunately, the benchmark doesn't tell the whole story. Many of the regex-based solutions fail on unescaped regex characters.

All of the faster ones fail to correctly find the longest string when fed either of:

1111111121111111111112111111111111111111111112111111111111211111 ababacababacadacababacadaeadacabaz

(Including mine, which is sad, as the first one is my publish test string:()


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon


Comment on Re^3: Finding longest palindrome from a string
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://382854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-09-17 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (66 votes), past polls