All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface DataStructures.PriorityQueue

public abstract interface PriorityQueue
Protocol for priority queues.


Method Index

 o deleteMin()
Remove the smallest item from the priority queue.
 o findMin()
Find the smallest item in the priority queue.
 o insert(Comparable)
Insert into the priority queue.
 o isEmpty()
Test if the priority queue is logically empty.
 o makeEmpty()
Make the priority queue logically empty.

Methods

 o insert
 public abstract void insert(Supporting.Comparable x)
Insert into the priority queue. Duplicates are allowed.

Parameters:
x - the item to insert.
 o findMin
 public abstract Supporting.Comparable findMin() throws Exceptions.Underflow
Find the smallest item in the priority queue.

Returns:
the smallest item.
Throws: Underflow
if the priority queue is empty.
 o deleteMin
 public abstract Supporting.Comparable deleteMin() throws Exceptions.Underflow
Remove the smallest item from the priority queue.

Returns:
the smallest item.
Throws: Underflow
if the priority queue is empty.
 o makeEmpty
 public abstract void makeEmpty()
Make the priority queue logically empty.

 o isEmpty
 public abstract boolean isEmpty()
Test if the priority queue is logically empty.

Returns:
true if empty, false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index