Skip to content

Glossary: Algorithms Beyond the Basics in Rust

KMP (Knuth-Morris-Pratt)

Also written: KMP, string matching

A fast string-matching algorithm that finds a pattern inside a longer text in linear time. It avoids rechecking letters by using what it has already matched.

Where the book teaches it

Related terms

Fenwick tree