Ch.4 · Level 06

KMP 匹配

构建 next 数组,失配时 j ← next[j-1],主串指针 i 不回退。

S / 主串
arrow_back 返回关卡库

KMP 匹配

主串 S="ABABCABAB",模式串 P="ABAB"。先构建 next,再执行 KMP 匹配。

⌘ + Enter to run
guest@aq-shell:~ (bash)
terminal
0 / 0