For each algorithm (the version discussed in lecture and the textbook),
give the worst-case order of growth in terms of M and N.
------ brute-force substring search for a query string of size M
in a text string of size N
------ Knuth-Morris Pratt substring search for a query string of
size M in a text string of size N
------ Boyer-Moore (with only mismatch heuristic) substring
search for a query string of size M in a text string of size
N
------ simulating a DFA with M vertices and 2M edges on a text
string of size N
Answers
MN, N or M + N, MN, N or M + N, MN, N, MN