All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface tw.edu.ncnu.im.cnclab.DataStru.PriorityQueue

public interface PriorityQueue
Protocol for priority queues.

Author:
Origional from Mark Allen Weiss , modified by Ding-Yi Chen on Mar 5, 1999.

Method Index

 o deleteMin()
Remove the smallest item from the priority queue.
 o findMin()
Find the smallest item in the priority queue.
 o insert(Comparable11)
Insert into the priority queue.
 o isEmpty()
Test if the priority queue is logically empty.
 o makeEmpty()
Make the priority queue logically empty.
 o toss(Comparable11)
Insert into the priority queue quickly, ignore the PriorityQueue validity Duplicates are allowed.
 o validate()
Validate the priority queue.

Methods

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

Parameters:
x - the item to insert.
 o findMin
 public abstract Comparable11 findMin() throws 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 Comparable11 deleteMin() throws Underflow
Remove the smallest item from the priority queue.

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

Returns:
true if empty, false otherwise.
 o makeEmpty
 public abstract void makeEmpty()
Make the priority queue logically empty.

 o toss
 public abstract void toss(Comparable11 x)
Insert into the priority queue quickly, ignore the PriorityQueue validity Duplicates are allowed.

Parameters:
x - the item to insert.
 o validate
 public abstract void validate()
Validate the priority queue.


All Packages  Class Hierarchy  This Package  Previous  Next  Index