What is another name for the brute force algorithm?
Exhaustive search
Steps of the naive brute force algorithm?
What is the complexity of the brute force approach?
O(nm)
There are m char comparisons at each (n-(m+1)) char, which is m * n.
What complexity of the brute force approach do we expect on average? WHY?
O(n), as typically there will only be one comparison per character to show mismatch.(string not iterated through)