Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-10-04 23:55 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (105 votes), past polls