单调队列Monotonic Queue

leetcode中有一个找到移动窗口中的最大值,用到了Monotonic Queue,使用deque实现。

保存windows中最大值或者较大值即可。

你可能感兴趣的:(LeetCode算法小技巧)