摘要: KMP算法的要点是避免回溯和Next[]数组,其中,Next[]数组中存的是最长公共前后缀的长度. 1.KMP模板 例题:HDU2087剪花布条 int Next[N],cnt;//构建Next[]数组 void getNext(char *p,int plen){ Next[1]=Next[0]= 阅读全文
posted @ 2023-03-25 21:21 天雷小兔 阅读(28) 评论(0) 推荐(0)