摘要: #include getNext(char str[],int n, int next[]){ int i, j; i = 1; j = 0; next[0] = -1; next[1] = 0; while(i < n){ if(str[i] == str[j]){ i++; j++; next[i] = j; } else if(j == 0){ i++; next[i] = 0; } ... 阅读全文
posted @ 2014-02-26 16:30 yutoulck 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include int find(int num[], int b, int e){ int temp = num[b]; int i = b; int j = e; while(i temp) j--; if(i b){ kp(num, b, n - 1); } if(n < e){ kp(num, n + 1, e); }}main(){ int i; int num[] = {1, -2, 3, 10, -4, 7, 2, -5,}; kp(num, 0, 7); for(i... 阅读全文
posted @ 2014-02-26 16:09 yutoulck 阅读(179) 评论(0) 推荐(0) 编辑