• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is PriorityQueue Sorted  RSS feed

 
ravisha andar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Can any body please let me know if PriorityQueue is sorted.

Thanks
 
Stephan van Hulst
Saloon Keeper
Posts: 7991
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may depend on the implementation. PriorityQueue makes no guarantees anyway. Does it really matter? The peek() and poll() methods always return the least element.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class Javadoc says all you need to know.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!