5 ms·My guess is that naive searcher is O(nm) and two way is O(n) for haystack length n and needle length m.by TTPrograms 12y agoMy guess is that naive searcher is O(nm) and two way is O(n) for haystack length n and needle length m.