1、priorityQueue
大根堆
PriorityQueue<Integer> queue = new PriorityQueue<Integer>(new Comparator<Integer>(){ public int compare(Integer num1, Integer num2){ return num2-num1; } });
queue.peek()
queue.poll()
queue.offer()
2022-04-04 00:54:57
大根堆
PriorityQueue<Integer> queue = new PriorityQueue<Integer>(new Comparator<Integer>(){ public int compare(Integer num1, Integer num2){ return num2-num1; } });
queue.peek()
queue.poll()
queue.offer()