Constructor and Description |
---|
BinaryHeapNode() |
BinaryHeapNode(SoftHeap.BinaryHeapNode leftChild,
SoftHeap.BinaryHeapNode rightChild,
T key,
int rank) |
Modifier and Type | Method and Description |
---|---|
void |
insert(T element)
Inserts the given element into the selected node.
|
boolean |
isLeaf()
Returns whether a node is a leaf, which is the case
if both of its children don't exist.
|
int |
sift()
Replenishes the elements associated with the given key
if the amount of elements in the list
has dropped below size / 2.
|
public BinaryHeapNode(SoftHeap.BinaryHeapNode leftChild, SoftHeap.BinaryHeapNode rightChild, T key, int rank)
public BinaryHeapNode()
public void insert(T element)
element
- the element to be insertedjava.lang.IllegalArgumentException
- in case the key is too largepublic boolean isLeaf()
public int sift()