2 ms·
Of course in string search it never is. In m=n case KMP would simply compare the first character, and if it doesn't match declare nothing was found. Yes there'
by waps 12y ago
Of course in string search it never is. In m=n case KMP would simply compare the first character, and if it doesn't match declare nothing was found.
Yes there'd be much more different instructions involved but I think KMP would start beating naive pretty quickly in the m=n case.