摘要:
import java.util.*;//思路:用一个大顶堆,保存当前滑动窗口中的数据。滑动窗口每次移动一格,就将前面一个数出堆,后面一个数入堆。public class Solution { public PriorityQueue<Integer> maxQueue = new Priority 阅读全文
摘要:
import java.util.Stack;public class Solution { Stack<Integer> stack1 = new Stack<Integer>(); Stack<Integer> stack2 = new Stack<Integer>(); public void 阅读全文