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)
2. Given the pattern to be found, which of the following is the correct LPS array?
Pattern = AABAAC
Pattern = AABAAC
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"
Input String = "TSATLEADSAT"
Pattern = "SAT"
4. Which of the following is a key advantage of KMP over the naive string searching algorithm?
5. Which of the following best describes the role of the LPS array in the KMP algorithm?
6. Which of the following is NOT a valid property of the KMP algorithm?