摘要:
BM算法的简化版后缀匹配。若不匹配,那么跳转为主串最后一个字符在模式串中出现的最右位置,若没出现,那么直接跳转模式串的长度。int horspool(char* T,char* P){ int len_p = strlen(P); int len_t = strlen(T); int B[256] = {0}; for(int i = 0 ; i < 256 ; i++) B[i] = len_p; for(int i = 0 ; i < len_p ; i++) B[P[i]] = len_p - i - 1; int pos = 0; while(pos <= len_t 阅读全文
posted @ 2013-05-29 14:38 1957 阅读(741) 评论(0) 推荐(0)
浙公网安备 33010602011771号