Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: An efficient way to gather a common portion of several strings' beginnings

by LanX (Saint)
on Nov 17, 2015 at 22:48 UTC ( [id://1147960]=note: print w/replies, xml ) Need Help??


in reply to Re^2: An efficient way to gather a common portion of several strings' beginnings
in thread An efficient way to gather a common portion of several strings' beginnings

> Update 2. Sometimes one is the most oblivious to the most obvious. Added the third version lcp_v6.

I could call using modules cheating, but

a) it's core

b) you have to admit that hippo's sort approach is sexy!

--- with le/ge abcdefghijklmnopqrstuvwxyz0.000100071512918021 abcdefghijklmnopqrstuvwxyz9.83499014282074e-05 0.786839962005615 --- with minstr/maxstr abcdefghijklmnopqrstuvwxyz0.000100071512918021 abcdefghijklmnopqrstuvwxyz9.83499014282074e-05 0.23346209526062

Though your final comparison fails with some edge cases :-P

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^3: An efficient way to gather a common portion of several strings' beginnings
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-16 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found