All Packages Class Hierarchy This Package Previous Next Index
Class DataStructures.BinomialQueue
java.lang.Object
|
+----DataStructures.BinomialQueue
- public class BinomialQueue
- extends Object
Implements a binomial queue.
Note that all "matching" is based on the compareTo method.
BinomialQueue()
- Construct the binomial queue.
deleteMin()
- Remove the smallest item from the priority queue.
findMin()
- Find the smallest item in the priority queue.
insert(Comparable)
- Insert into the priority queue, maintaining heap order.
isEmpty()
- Test if the priority queue is logically empty.
isFull()
- Test if the priority queue is logically full.
main(String[])
-
makeEmpty()
- Make the priority queue logically empty.
merge(BinomialQueue)
- Merge rhs into the priority queue.
BinomialQueue
public BinomialQueue()
- Construct the binomial queue.
merge
public void merge(BinomialQueue rhs) throws Overflow
- Merge rhs into the priority queue.
rhs becomes empty. rhs must be different from this.
- Parameters:
- rhs - the other binomial queue.
- Throws:
Overflow
- if result exceeds capacity.
insert
public void insert(Comparable x) throws Overflow
- Insert into the priority queue, maintaining heap order.
This implementation is not optimized for O(1) performance.
- Parameters:
- x - the item to insert.
- Throws:
Overflow
- if capacity exceeded.
findMin
public Comparable findMin()
- Find the smallest item in the priority queue.
- Returns:
- the smallest item, or null, if empty.
deleteMin
public Comparable deleteMin()
- Remove the smallest item from the priority queue.
- Returns:
- the smallest item, or null, if empty.
isEmpty
public boolean isEmpty()
- Test if the priority queue is logically empty.
- Returns:
- true if empty, false otherwise.
isFull
public boolean isFull()
- Test if the priority queue is logically full.
- Returns:
- true if full, false otherwise.
makeEmpty
public void makeEmpty()
- Make the priority queue logically empty.
main
public static void main(String[] args)
All Packages Class Hierarchy This Package Previous Next Index