+1 vote
in JAVA by
The difference between LinkedHashMap and PriorityQueue in Java?

1 Answer

0 votes
by

PriorityQueue guarantees that lowest or highest priority element always remain at the head of the queue, but LinkedHashMap maintains the order on which elements are inserted. When you iterate over a PriorityQueue, iterator doesn't guarantee any order but iterator of LinkedHashMap does guarantee the order on which elements are inserted.

Related questions

0 votes
asked Oct 10, 2020 in JAVA by Robindeniel
0 votes
asked Oct 22, 2020 in JAVA by sharadyadav1986
...