🎴 Flashcard Mode

String Matching Algorithms

Card1 / 15
Mastered0
Review0
QuestionClick to flip

Which string matching algorithm is best suited for finding all occurrences of a pattern in a text?

AnswerClick to flip back
A
Knuth-Morris-Pratt (KMP)
💡 Explanation:

The Knuth-Morris-Pratt (KMP) algorithm is designed to find all occurrences of a pattern in a text efficiently by utilizing a precomputed failure function.

Change Mode