haoel / leetcode

LeetCode Problems' Solutions
17.59k stars 4.91k forks source link

the KMP implementation of strstr is not O(n) for worst case #18

Open WilsonFWL opened 9 years ago

WilsonFWL commented 9 years ago

For strStr1 in "https://github.com/haoel/leetcode/blob/master/src/strStr/strStr.cpp", below case will get a complexity of O(m*n) strStr1("aaaaaaaaaaaaaaaaaa","aaaaaab");

JKair commented 9 years ago

I think must sunday