Safe Haskell | None |
---|---|
Language | Haskell2010 |
Knuth-Morris-Pratt algorithm
A string matching algorithm that generates a prefix function p from an input string s, where p(i) is the length of the longest prefix of s that ends at index i, excluding the prefix [0..i].
Sources:
Synopsis
- prefixFunc :: Eq a => Int -> (Int -> a) -> UArray Int Int
- prefixFuncBS :: ByteString -> UArray Int Int