Expand description
Knuth–Morris–Pratt pattern matching algorithm
Functions§
- kmp_
find - Finds a
needlein ahaystackusing theKnuth–Morris–Pratt algorithm. - kmp_
find_ with_ lsp_ table - Finds a
needlein ahaystackusing theKnuth–Morris–Pratt algorithmwith a givenlongest suffix-prefixtable generated bykmp_table. - kmp_
match - Matches a
needlein ahaystackusing theKnuth–Morris–Pratt algorithmreturning a vector of positions in thehaystack. - kmp_
match_ with_ lsp_ table - Matches a
needlein ahaystackusing theKnuth–Morris–Pratt algorithmwith a givenlongest suffix-prefixtable generated bykmp_tableand returns a vector of positions in thehaystack. - kmp_
table - Generate a list of possible fallback positions for the needle, called a
longest suffix-prefixtable. This can also be used if multiple haystacks are to be searched with the same needle, reducing the amount of table generation to one. Functions using this table all end with_with_lsp_table.