摘要: *Java双端队列的知识 Deque 接口是 double ended queue 的缩写,即双端队列,支持在队列的两端插入和删除元素,继承 Queue接口。public interface Deque extends Queue Deque 的 12 种方法总结如下: 插入: 如果操作失败则抛出异 阅读全文
posted @ 2020-03-08 14:27 雪瞳 阅读(2115) 评论(0) 推荐(0) 编辑
摘要: /** * 问题: 生成窗口最大值数组 * 有一个整形数组array和一个大小为w的窗口从数组最左边滑到最右边,窗口每次向右边滑动一个位置。 * 例如,数组为[4,3,5,4,3,3,6,7],窗口大小为3时: * [4 3 5] 4 3 3 6 7 窗口的最大值是5 * 4 [3 5 4] 3 3 阅读全文
posted @ 2020-03-08 14:24 雪瞳 阅读(264) 评论(0) 推荐(0) 编辑