The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

LCS::Tiny - Tiny implementation of the Longest Common Subsequence (LCS) Algorithm

SYNOPSIS

  use LCS::Tiny;

  $alg = LCS::Tiny->new;
  $lcs = $alg->LCS(\@a,\@b);

ABSTRACT

LCS::Tiny is a heavily tuned version based on Algorithm::Diff

DESCRIPTION

CONSTRUCTOR

new()

Creates a new object which maintains internal storage areas for the LCS computation. Use one of these per concurrent LCS() call.

METHODS

LCS(\@a,\@b)

Finds a Longest Common Subsequence, taking two arrayrefs as method arguments. It returns a list of corresponding indices, which are represented by 2-element array refs.

EXPORT

None by design.

SEE ALSO

Algorithm::Diff

REFERENCES

James W. Hunt and Thomas G. Szymanski. A fast algorithm for computing longest common subsequences. Communications of the ACM, 20(5):350-353, 1977.

Hunt, J.W. and McIlroy, M.D. An Algorithm for Differential File Comparison. Computing Science Technical Report 41, Bell Laboratories (1975).

AUTHOR

Helmut Wollmersdorfer <helmut.wollmersdorfer@gmail.com>

COPYRIGHT AND LICENSE

Copyright 2014-2015 by Helmut Wollmersdorfer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.