mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-06 15:09:40 +08:00
Update
This commit is contained in:
@ -4,11 +4,12 @@ https://leetcode-cn.com/problems/implement-strstr/
|
||||
|
||||
## 思路
|
||||
|
||||
KMP 经典算法
|
||||
KMP的经典思想是:当出现字符串不匹配时,可以记录一部分之前已经匹配的文本内容,利用这些信息避免从头再去做匹配。
|
||||
|
||||
## C++代码
|
||||
|
||||
```
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
void preKmp(int* next, const string& s){
|
||||
|
Reference in New Issue
Block a user