KMP Algorithm

1. Which one of the following is true in the KMP String searching algorithm? (strInd = iterator in the main string)
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. How does KMP improve the brute-force method?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. What is the first step in the KMP algorithm before searching for the pattern in the text?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. Which of the following is NOT a possible value in the LPS array for the pattern 'ABABAC'?

Explanation

Explanation

Explanation

Explanation

5. Which of the following best describes the worst-case time complexity of the KMP algorithm? (M = length of pattern, N = length of text)
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

6. Which of the following is a limitation of the KMP algorithm?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation