一、PriorityQueue和Queue
class myCom implements Comparator<Integer>{
@Override
public int compare(Integer num1,Integer num2){
return num1 - num2;
}
}
PriorityQueue<Integer> heap = new PriorityQueue<>(new myCom());
Queue<Integer> queue = new LinkedList<>();原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。