Modern answer, as of 2021: https://stackoverflow.com/a/30015986/139010
Pre-Java-8 answer, for posterity:
There is no such constructor. As per the JavaDocs, the default capacity is 11, so you could specify that for analogous behavior to the no-arg PriorityQueue
constructor:
Queue<Node> theQueue = new PriorityQueue<Node>(11,new Comparator<Node>());
And yes, the queue will grow if it needs to.
A priority queue is unbounded, but has an internal capacity governing the size of an array used to store the elements on the queue. It is always at least as large as the queue size. As elements are added to a priority queue, its capacity grows automatically. The details of the growth policy are not specified.x