blob: 9292058d173782000ff431e13aa38d1f81973c04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>haskell</herd>
<longdescription>
Provides a function lcs that takes two lists and returns a longest
common sublist. For example, lcs "abcd" "acbd" is either "abd" or
"acd".
The package provides a simple, stupid and (most of all) slow
implementation that needs, for inputs of length m and n, O(m+n)
space and O((m+n)!) time in the worst case.
It also provides an implementation of the Hunt-Szymanski LCS
algorithm, based on that in "String searching algorithms" by
Graham A Stephen, ISBN 981021829X.
Given inputs xs and ys of length m and n respectively, where there
are r pairs (x, y) where x is in xs, y is in ys and x == y,
Hunt-Szymanski needs O(r+m+n) space and O((r+m+n)*log(m+n)) time.
Thus this is O((m+n)^2) space and O((m+n)^2*log(m+n)) time in the
worst case.
</longdescription>
</pkgmetadata>
|