Encyclopedia of Machine Learning

2010 Edition
| Editors: Claude Sammut, Geoffrey I. Webb

String Matching Algorithm

Reference work entry
DOI: https://doi.org/10.1007/978-0-387-30164-8_791

A string matching algorithm returns parts of text matching a given pattern, such as a regular expression. Such algorithms have countless applications, from file editing to bioinformatics. Many algorithms compute deterministic finite automata, which can be expensive to build, but are usually efficient to use; they include the Knuth–Morris–Pratt algorithm and the Boyer–Moore algorithm, that build the automaton in time O(m) and O(m + s), respectively, where m is the length of the pattern and s the size of the alphabet, and match a text of length n in time O(n) in the worst case.

Copyright information

© Springer Science+Business Media, LLC 2011