Abstract

Given two sequences A = a1a2 . . . am and B = b1b2 . . . bn, m 6 n, over some alphabet Σ of size s the longest common subsequence (LCS) problem is to find a sequence of greatest possible length that can be obtained from both A and B by deleting zero or more (not necessarily adjacent) symbols. Applications for the LCS problem arise in many different areas since the length, p, of a longest common subsequence can be viewed as a simple measure of similarity between two sequences. There is a wide range of efficient algorithms, suiting different purposes, which can compute the length of an LCS using only linear space [7]. The space requirement of these algorithms usually rises to O(mn) when a longest common subsequence has to be constructed, and, as stated in [2], it is not obvious in general that an LCS algorithm can be adapted to run in linear space without substantial alteration of its time complexity. In this paper we show how to maintain the O(min{pm,p(n − p)}) time complexity and linear space of the algorithm introduced in [11] which seems to have been widely accepted as very fast and flexi-

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