Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^6: Longest Common Subsequence Question

by sgt (Deacon)
on Nov 19, 2007 at 14:06 UTC ( [id://651666]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Longest Common Subsequence Question
in thread Longest Common Subsequence Question

Humm Makes me think...:)

Actually mathematical subsequences are defined as maps on a subset of N and have "holes"; for example consider u(2n) versus u(n). Still in the case of finite sequences (especially in the context of char strings) it seems *contiguous* would be a fair (even natural) requisite.

Looking at some implementations seems to indicate that the contiguous case is considered as the common useful case:

% steph@ape (/home/stephan/w/tp) % % perl -MString::LCSS -le 'print scalar String::LCSS::lcss(qw[xaxbcxdx + aybycyydy])' % steph@ape (/home/stephan/w/tp) % % perl -MString::LCSS -le 'print scalar String::LCSS::lcss(qw[xabcdxxx +xxx yyyabcdyyyyy])' abcd

I get the same with the recent String::LCSS_XS

% steph@ape (/home/stephan/w/tp) % % perl -MString::LCSS_XS -le 'print scalar String::LCSS_XS::lcss(qw[xa +bcdxxxxxx yyyabcdyyyyy])' abcd
cheers --stephan

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-28 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found