3 ms·
It's the same when m=n.
by rimantas 12y ago
It's the same when m=n.
- waps 12y agoOf 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.
- deleted 12y ago[deleted]