Class PriorityQueue

Hierarchy: Object , PriorityQueue
public class PriorityQueue
A priority queue over a set of Comparable objects.
Authors:
Martin Davis
public PriorityQueue()
Creates a new empty priority queue
public void add(Comparable x)
Insert into the priority queue. Duplicates are allowed.
Parameters:
x - x the item to insert.
public boolean isEmpty()
Test if the priority queue is logically empty.
Returns:
true if empty, false otherwise.
public int size()
Returns size.
Returns:
current size.
public void clear()
Make the priority queue logically empty.
public Object poll()
Remove the smallest item from the priority queue.
Returns:
the smallest item, or null if empty
public Object peek()