Assignment on the KMP Algorithm
Assignment on the KMP Algorithm
P.S. The assignment needs to be done in groups of 3. For every group there has to be one submission
mentioning the names of all three students. Please upload your submissions here:
https://drive.google.com/drive/folders/1lbb0Xdi0-vLBsEL9sRKToLPb05KOjR8N?usp=sharing
For each of the following questions, use the KMP algorithm to find index in the text at which the
pattern begins. Text starts with index 0. Show the complete working of the algorithm.
1. Pattern: AAABAAAB
Text: AAAAAAACAAABAAAB
2. Text: ABABDABACDABABCABAB
Pattern: ABABCABAB