Answer
See explanation
Work Step by Step
The worst case will occur when no occurrence of pattern is present in the text but at every step the pattern almost matches with the text for example-
text= xxxxxxxxxxxxxx
pattern = xxy
In this case we will need to do (n-m-1)*(m-1) comparisions.