in Java, I donβt know how to create a new one PriorityQueuewith a new comparator, but without specifying the length of the queue? How to create it?
I know I can write:
Queue<Node> theQueue = new PriorityQueue<Node>(15,new Comparator<Node>();
But I hope that the queue can work like LinkedList, I mean, its length is not fixed, how can I declare it?
source
share