2007年7月14日
摘要: #include"stdafx.h"#include<string.h>#include<iostream>#include<vector>usingnamespacestd;//模式匹配,kmp算法,复杂度O(m+n)//返回匹配位置,-1表示匹配失败,传入匹配串和模式串和长度//可更改元素类型,更换匹配函数#defineMAXN100#define_match(a,b)((a)==(b))typedefcharelem_t;intkmp_match(intls,elem_t*str,intlp,elem_t*pat)...{intfa 阅读全文
posted @ 2007-07-14 19:32 sun_kang 阅读(165) 评论(0) 推荐(0) 编辑