Knuth-Morris-Pratt algorithm

Описание к видео Knuth-Morris-Pratt algorithm

An animation of the Knuth-Morris-Pratt algorithm, showing how the prefix function lets us continue matching shorter and shorter prefixes of the pattern until we find a places where we can continue the match. When we fail to match the b in T[ 8 ] in the text, we first consider continuing the 3-character match from the start of the pattern "aba" (which we can't), then the 1-character match, "a" (which we can).

Комментарии

Информация по комментариям в разработке