STRING MATCHING

how you calculate the expression m * ( n-m+1) how u get that?

hi @Anusree_Dey

O() notation denotes worst case time complexity

so O(m*(n-m+1))=O(mn-m^2+m)
now among m
n ,m^2 m worst or max time is mn so we can write
it as O(m
n)

mn >=mm because n>=m

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.