Abstract

The Longest Common Subsequence (LCS) problem is a classic and well-studied problem in computer science. Given strings S1, S2 and P, the generalized constrained longest common subsequence problem (GC-LCS) for S1 and S2 with respect to P is to find a longest common subsequence of S1 and S2, which contains (excludes) P as a subsequence (substring). We present finite automata based algorithms with time complexity O(r(n+m)+(n+m) log(n+m)) for a fixed sized alphabet, where r, n and m are the lengths of P, S1 and S2 respectively.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call