Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
lcs :: Eq a => [a] -> [a] -> Int Source
Compute the length of the longest common subsequence of two lists. This is a simple implementation with memoization that uses quadratic space (O(n*m) where n and m are the length of the inputs). Note: a possible optimization would be to cache the memoized matrix as a lot of it is still relevant when a new character is added.
sortCandidates :: Eq a => [[a]] -> [a] -> [[a]] Source