java 那些年不习惯的方法

时间:2021-09-03 19:08:43   收藏:0   阅读:22

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()

 

原文:https://www.cnblogs.com/r1-12king/p/15221445.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!