Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's the same when m=n.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: