mirror of
https://github.com/chefyuan/algorithm-base.git
synced 2026-03-26 03:35:37 +00:00
chefyuan
This commit is contained in:
@@ -33,9 +33,7 @@
|
||||
|
||||
下面我们来看一下我们的动画模拟,一下就能看懂!
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="https://img-blog.csdnimg.cn/20210320092423565.gif" style="zoom:150%;" />
|
||||
|
||||
其实,我们只要把握两个重点即可,我们的 maxdeque 维护的是一个单调递减的双端队列,头部为当前窗口的最大值, mindeque 维护的是一个单调递增的双端队列,头部为窗口的最小值,即可。好啦我们一起看代码吧。
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
|
||||
**
|
||||
*
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
[2, 3, 1, 0, 2, 5, 3]
|
||||
输出:2 或 3
|
||||
|
||||
**HashSet**
|
||||
#### **HashSet**
|
||||
|
||||
**解析**
|
||||
|
||||
@@ -39,7 +39,7 @@ class Solution {
|
||||
}
|
||||
```
|
||||
|
||||
**原地置换**
|
||||
#### **原地置换**
|
||||
|
||||
**解析**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user