update 0028.实现strStr:添加复杂度分析
This commit is contained in:
parent
cc1a327fb1
commit
167cb84ee3
|
|
@ -444,6 +444,8 @@ public:
|
|||
};
|
||||
|
||||
```
|
||||
* 时间复杂度: O(n + m)
|
||||
* 空间复杂度: O(m), 只需要保存字符串needle的前缀表
|
||||
|
||||
# 前缀表(不减一)C++实现
|
||||
|
||||
|
|
@ -540,6 +542,9 @@ public:
|
|||
}
|
||||
};
|
||||
```
|
||||
* 时间复杂度: O(n + m)
|
||||
* 空间复杂度: O(m)
|
||||
|
||||
|
||||
# 总结
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue