數據結構——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
相關文章
相關標籤/搜索