Re: divide & conquer algorithm to implement string matching



Maybe I'm wrong,but to me it seems that if I consider the lenght of
the pattern to search a constant this algorithm takes O(n) time to
compute the solution,if the length of the pattern is varying,in the
worst case (that should be if the lenght of the pattern is an half of
the lenght of the main string)this algorithm could take O(n^2) time to
compute the solution.Am I right?

.