数据结构——KMP算法的实现

// KMP字符串模式匹配算法 // 输入: S是主串,T是模式串,pos是S中的起始位置 // 输出: 若是匹配成功返回起始位置,不然返回-1 int KMP(PString S, PString T, int pos) { assert(NULL != S); assert(NULL != T); assert(pos >= 0); assert(pos < S
相关文章
相关标签/搜索