$25
You are to implement the Karp-Rabin string search algorithm. Your program will prompt for the name of an input file and then read and process the data contained in this file.
The file contains two sequences of characters. The first is the target sequence, T, the second is the search sequence S. Read both strings and find all occurrences of sequence S in sequence T using the KarpRabin algorithm.
For each matched sequence, print the location of the first matched character in T.
For example, if the test data looked like this:
ACGTACGTACCAGTA AC
The output should be:
0, 4, 8