Which one of the following statements about the order in which a PriorityQueue's iterator visits elements is true?
Answer: A
The queue is a heap, which orders only enough to know the head; the javadoc states the iterator is not guaranteed to traverse in any particular order. Elements come out in priority order through repeated poll, not by iterating or printing the queue.
Please log in or register to report this question.