KMP Algorithm

1. What is the time complexity of the KMP Algorithm?( M = length of pattern , N = length of string in which pattern is searched)
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. Given the pattern to be found, which of the following is the correct LPS array ?
Pattern = AABAAC
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. Given Input String and Pattern , find the first index of the input string that matches the pattern using the KMP algorithm
Input String = “TSATLEADSAT”
Pattern = “SAT”

Explanation

Explanation

Explanation

Explanation

Explanation