Hi,
In my text book, it shows
for i = 1 to N - M + 1 do
if s(i|M) == p then FOUND
Time complexity is O(MN).
I think that is the naive algorithm.
However, for the assignment I am supposed to do, the test data are files with lots of "A" and another 1 with random "ACGT". So how these affects the time complexity?