|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.PQ
public class PQ
Priority Queue class
| Constructor Summary | |
|---|---|
PQ()
Construct an empty PQ |
|
PQ(int maxsize)
Construct an empty PQ of initial size maxsize |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Comparable c)
Adds an element to the PQ |
void |
clear()
Empty the array, alternatively could reallocate |
java.lang.Comparable |
inspectLeast()
Inspect but don't remove the smallest element |
boolean |
isEmpty()
Check if the heap is empty |
static void |
main(java.lang.String[] args)
Main method is used for testing |
java.lang.Comparable |
removeLeast()
remove the smallest element from the PQ |
int |
size()
Return the number of elements in the heap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PQ()
public PQ(int maxsize)
maxsize - the initial size of the internal storage array| Method Detail |
|---|
public java.lang.Comparable inspectLeast()
inspectLeast in interface IPQpublic void clear()
clear in interface IPQpublic boolean isEmpty()
isEmpty in interface IPQpublic int size()
size in interface IPQpublic java.lang.Comparable removeLeast()
removeLeast in interface IPQpublic void add(java.lang.Comparable c)
add in interface IPQc - the object to add to the PQpublic static void main(java.lang.String[] args)
args - the command line args
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||