Examveda

In which situation does the Knuth-Morris-Pratt (KMP) algorithm perform particularly well?

A. When the pattern is very short.

B. When the text is randomly structured.

C. When the text contains many repetitions.

D. When the pattern is long and the text is large.

Answer: Option D


This Question Belongs to Data Structure >> String Matching

Join The Discussion

Related Questions on String Matching