Skip to main content
Log in

A linear space algorithm for the LCS problem

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

The LCS problem is to determine the longest common subsequence (LCS) of two strings. A new linear-space algorithm to solve the LCS problem is presented. The only other algorithm with linear-space complexity is by Hirschberg and has runtime complexity O(mn). Our algorithm, based on the divide and conquer technique, has runtime complexity O(n(m-p)), where p is the length of the LCS.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho, A.V., Hirschberg, D.S., Ullmann, J.D.: Bounds on the complexity of the longest common subsequence problem. JACM 23, 1–12 (1976)

    Google Scholar 

  2. Dayhoff, M.O.: Computer analysis of protein evolution. Scientific American 221, 86–95 (1969)

    Google Scholar 

  3. Hirschberg, D.S.: A linear space algorithm for computing maximal common subsequences. Commun. ACM 18, 341–343 (1975)

    Google Scholar 

  4. Hirschberg, D.S.: Algorithms for the longest common subsequence problem. JACM 2b4, 664–675 (1977)

    Google Scholar 

  5. Hsu, W.J., Du, M.W.: New algorithms for the LCS problem. J. Comput. Syst. Sci. 29, 133–152 (1984)

    Google Scholar 

  6. Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 2b0, 350–353 (1977)

    Google Scholar 

  7. Lu, S.Y., Fu, K.S.: A sentence-to-sentence clustering procedure for pattern analysis. IEEE Trans. Syst. Man. Cybernet. SMC-8, 381–389 (1978)

    Google Scholar 

  8. Maier, D.: The complexity of some problems on subsequences and supersequences. JACM 25, 322–336 (1978)

    Google Scholar 

  9. Masek, W.J., Paterson, M.S.: A faster algorithm for computing string edit distances. J. Comput. Syst. Sci. 20, 18–31 (1980)

    Google Scholar 

  10. Mukhopadhyay, A.: A fast algorithm for the longest-common-subsequence problem. Inf. Sci. 20, 69–82 (1980)

    Google Scholar 

  11. Nakatsu, N., Kambayashi, Y., Yajima, S.: A longest common subsequence algorithm suitable for similar text strings. Acta Inf. 18, 171–179 (1982)

    Google Scholar 

  12. Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. JACM 21, 168–173 (1974)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kumar, S.K., Rangan, C.P. A linear space algorithm for the LCS problem. Acta Informatica 24, 353–362 (1987). https://doi.org/10.1007/BF00265993

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00265993

Keywords

Navigation