update sort

This commit is contained in:
ranwenjie
2021-09-13 14:43:50 +08:00
parent d1ad2f3dbb
commit f72365e833
8 changed files with 169 additions and 65 deletions
+22
View File
@@ -22,6 +22,28 @@
* BM
## 滑动窗口
使用滑动窗口解决字符串问题,代码框架
```
int left = 0, right = 0;
while (right < s.size()) {
// 增大窗口
window.add(s[right]);
right++;
while (window needs shrink) {
// 缩小窗口
window.remove(s[left]);
left++;
}
}
```
## 参考
《Algorithms》