![]() |
|
P is for Practical | |
PerlMonks |
Re^6: Longest Common Subsequence Question (no)by tye (Sage) |
on Nov 19, 2007 at 05:49 UTC ( #651595=note: print w/replies, xml ) | Need Help?? |
No, it wouldn't; it is just harder to come up with the counter example. The one that pops into my mind is due to the fact that an algorithm that claims to find "the longest common subsequence" will actually find "one of the maximal common subsequences" and you may have needed to find some other one:
If the first run picks "axc" then you are doomed. If you get lucky and it picks "abc", then you win. But I strongly suspect that you don't even need to rely on that quirk. Indeed, I now see that it is easy to extend the above example:
The solution is "abc" but you will first pick "axyc" and so won't include "b" in the final "answer". - tye
In Section
Seekers of Perl Wisdom
|
|