|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.ece.iacl.jist.structures.data.BinaryMinFastHeap
public class BinaryMinFastHeap
Implements a binary heap. Note that all "matching" is based on the compareTo method.
Constructor Summary | |
---|---|
BinaryMinFastHeap(Indexable[] items)
Construct the binary heap from an array. |
|
BinaryMinFastHeap(int capacity,
int XN,
int YN,
int ZN)
Instantiates a new binary min fast heap. |
Method Summary | |
---|---|
void |
add(Indexable x)
Insert into the priority queue. |
void |
change(int i,
int j,
int k,
Indexable x)
Change. |
long |
hash(int i,
int j,
int k,
int c)
Hash. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
int |
lookup(int i,
int j,
int k,
int c)
Lookup. |
void |
makeEmpty()
Make the priority queue logically empty. |
Indexable |
peek()
Find the smallest item in the priority queue. |
void |
percolateUp(int k)
Percolate up. |
Indexable |
remove()
Remove the smallest item from the priority queue. |
int |
size()
Returns size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryMinFastHeap(int capacity, int XN, int YN, int ZN)
capacity
- the capacityXN
- the xNYN
- the yNZN
- the zNpublic BinaryMinFastHeap(Indexable[] items)
items
- the inital items in the binary heap.Method Detail |
---|
public long hash(int i, int j, int k, int c)
i
- the ij
- the jk
- the kc
- the c
public int lookup(int i, int j, int k, int c)
i
- the ij
- the jk
- the kc
- the c
public void add(Indexable x)
x
- the item to insert.public void percolateUp(int k)
k
- the kpublic void change(int i, int j, int k, Indexable x)
i
- the ij
- the jk
- the kx
- the xpublic Indexable peek()
UnderflowException
- if empty.public Indexable remove()
UnderflowException
- if empty.public boolean isEmpty()
public int size()
public void makeEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |