Fork me on GitHub

KMP算法

KMP算法就是传说中的“看毛片”算法,学习这个算法的时候就像看毛片一样,头脑发热,气血膨胀,一度有种想退出计算机行业的冲动;学懂以后就像连着看了一天的毛片,心力憔悴,萎靡不振。

先是简单的视频讲解:https://www.bilibili.com/video/BV1jb411V78H?from=search&seid=4004175213182905207

然后是代码和最关键的“k=next[k]”的部分:https://blog.csdn.net/starstar1992/article/details/54913261?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase

如果还不懂,还有这个:https://blog.csdn.net/dark_cy/article/details/88698736?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.nonecase

posted @ 2020-06-17 15:53  shiyu-coder  阅读(180)  评论(0)    收藏  举报