Java priority queue.

Java priority queue.


Posted in : Core Java Posted on : December 9, 2010 at 5:07 PM Comments : [ 0 ]

Java priority queue.

Java priority queue.

The Queue class is used for providing a data structure which allows to store object in FIFO (First in First Out) format. But sometimes we requires to maintain object in a order. So we needs another implementation of Queue class called PriorityQueue class. The order of elements of priority Queue elements depends of natural order of elements or depends on comparator provides of construction time. In it you can add element in any order.

A priority queue is based of priority heap. So it is unbounded. 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. It is available in java.util package in java.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics