KMP

   public int strStr(String haystack, String needle) {
    if(needle == null ||needle.length()==0)return 0;
    if(haystack == null ||haystack.length()==0)return -1;
    int[] next = makeInt(needle);
    int j=0;
    int i=0;
    while(j

你可能感兴趣的:(KMP)