isLouisHsu / isLouisHsu.github.io

My Blog :-)
https://louishsu.xyz/
4 stars 1 forks source link

【算法】KMP | LOUIS' BLOG #65

Open isLouisHsu opened 4 years ago

isLouisHsu commented 4 years ago

https://louishsu.xyz/2020/04/22/%E3%80%90%E7%AE%97%E6%B3%95%E3%80%91KMP/

前言字符串匹配问题是指,给定source字符串和一个target字符串,你应该在source字符串中找出target字符串出现的第一个位置(从$0$开始)。如果不存在,则返回$-1$,例如输入:source = "abcaabaabcaabcacabaa",target = "abcacab"输出;$11$ 暴力匹配暴力匹配是指依次对source中的子字符串