AlgorithmsStringsEdit on GitHubEdit history
Two-Way String Matching
Crochemore–Perrin algorithm1991
A string search algorithm that splits the pattern at a critical factorization, comparing the right part from left to right and then the left part from right to left. It guarantees worst-case linear time with constant extra space and is used in implementations such as glibc's strstr.
Origin
Maxime Crochemore, Dominique Perrin (1991). Two-way string-matching. Journal of the ACM 38(3).doi:10.1145/116825.116845 — checked against Crossref, 2026-11-08
Lineage
Algorithms 3 · Relations 2
Parent algorithms
Where it came from
Knuth–Morris–Pratt1970
Author statementThe authors describe the algorithm as intermediate between Knuth–Morris–Pratt and Boyer–Moore. — doi:10.1145/116825.116845
Boyer–Moore1977
Author statementThe authors describe the algorithm as intermediate between Knuth–Morris–Pratt and Boyer–Moore. — doi:10.1145/116825.116845
Notable implementations
Paths checked against the GitHub default branch
Find more: GitHub · Semantic Scholar · Google Scholar · arXiv
Claims & disputes
Loading…