KMP算法的实现:
#include <stdio.h> #include <string.h> #include <stdlib.h> int strStr(char* haystack, char* needle) { if (haystack == NULL || needle == NULL) return -1; if (needle[0] == '
KMP算法的实现:
#include <stdio.h> #include <string.h> #include <stdlib.h> int strStr(char* haystack, char* needle) { if (haystack == NULL || needle == NULL) return -1; if (needle[0] == '