mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 08:50:15 +08:00
update 0028.实现strStr:添加复杂度分析
This commit is contained in:
@ -444,6 +444,8 @@ public:
|
||||
};
|
||||
|
||||
```
|
||||
* 时间复杂度: O(n + m)
|
||||
* 空间复杂度: O(m), 只需要保存字符串needle的前缀表
|
||||
|
||||
# 前缀表(不减一)C++实现
|
||||
|
||||
@ -540,6 +542,9 @@ public:
|
||||
}
|
||||
};
|
||||
```
|
||||
* 时间复杂度: O(n + m)
|
||||
* 空间复杂度: O(m)
|
||||
|
||||
|
||||
# 总结
|
||||
|
||||
|
Reference in New Issue
Block a user