我在整数Java中有优先级队列:
PriorityQueue<Integer> pq= new PriorityQueue<Integer>();
当我打电话时,pq.poll()我得到最小元素.
pq.poll()
问题:如何更改代码以获取最大元素?
java collections priority-queue
collections ×1
java ×1
priority-queue ×1