Handbook
Glossary
lcp ( seq1 seq2 -- n )
Vocabulary
z-algorithm
Inputs
seq1
a
sequence
seq2
a
sequence
Outputs
n
a non-negative integer
Word description
Outputs the length of longest common prefix of two sequences.
Definition
USING:
kernel
sequences
sequences.private
;
IN:
z-algorithm
:
lcp
( seq1 seq2 -- n )
[
min-length
dup
]
2keep
mismatch-unsafe
or*
;