📅  最后修改于: 2022-03-11 14:52:39.598000             🧑  作者: Mango
PriorityQueue pq = new PriorityQueue<>();
pq.add(5);
pq.add(10);
pq.add(2);
pq.peek(); //retrieve the first element
pq.poll(); //retrieve and remove the first element