过默 发表于 2013-5-19 20:13:00

算法编程

kmp算法,没有main函数,怎么打印模拟串在主串位置?谁有例子,写个出来。int main()
{
char str = " ababaaaba";
char str1 = " ababaa";
/* int next;
int i=1;

str = 9;

get_next( str, next );

for( i=1; i < 10; i++ )
{
printf("%d ", next);
}
*/
/* int i=1;
i=Index_KMP(str, str1, 3);*/
printf("在主串的第 %d\n", Index_KMP(" ababaaaba", " ababaa", 2));


return 0;
}
页: [1]
查看完整版本: 算法编程