Even though the Boyer-Moore string search algorithm is the standard benchmark for practical string search literature, there are other string matching algorithms that are also suitable for different purposes. In this small section, we present the following three, which are the most famous ones:
- Rabin-Karp
- Knuth-Morris-Pratt
- Aho-Corasick
However, only give out the implementation of Rabin-Karp.