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.


Constructor Index

 o BinomialQueue()
Construct the binomial queue.

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, maintaining heap order.
 o isEmpty()
Test if the priority queue is logically empty.
 o isFull()
Test if the priority queue is logically full.
 o main(String[])
 o makeEmpty()
Make the priority queue logically empty.
 o merge(BinomialQueue)
Merge rhs into the priority queue.

Constructors

 o BinomialQueue
public BinomialQueue()
Construct the binomial queue.

Methods

 o 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.
 o 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.
 o findMin
public Comparable findMin()
Find the smallest item in the priority queue.

Returns:
the smallest item, or null, if empty.
 o deleteMin
public Comparable deleteMin()
Remove the smallest item from the priority queue.

Returns:
the smallest item, or null, if empty.
 o isEmpty
public boolean isEmpty()
Test if the priority queue is logically empty.

Returns:
true if empty, false otherwise.
 o isFull
public boolean isFull()
Test if the priority queue is logically full.

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

 o main
public static void main(String[] args)

All Packages  Class Hierarchy  This Package  Previous  Next  Index