|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DataStructures.LeftistHeap
Implements a leftist heap. Note that all "matching" is based on the compareTo method.
Constructor Summary | |
LeftistHeap()
Construct the leftist heap. |
Method Summary | |
Comparable |
deleteMin()
Remove the smallest item from the priority queue. |
Comparable |
findMin()
Find the smallest item in the priority queue. |
void |
insert(Comparable x)
Insert into the priority queue, maintaining heap order. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
boolean |
isFull()
Test if the priority queue is logically full. |
static void |
main(java.lang.String[] args)
|
void |
makeEmpty()
Make the priority queue logically empty. |
void |
merge(LeftistHeap rhs)
Merge rhs into the priority queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LeftistHeap()
Method Detail |
public void merge(LeftistHeap rhs)
rhs
- the other leftist heap.public void insert(Comparable x)
x
- the item to insert.public Comparable findMin()
public Comparable deleteMin()
public boolean isEmpty()
public boolean isFull()
public void makeEmpty()
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |