Package arc.struct
Class BinaryHeap<T extends BinaryHeap.Node>
java.lang.Object
arc.struct.BinaryHeap<T>
-
Field Details
-
size
public int size
-
-
Constructor Details
-
BinaryHeap
public BinaryHeap() -
BinaryHeap
public BinaryHeap(int capacity, boolean isMaxHeap)
-
-
Method Details
-
add
-
add
-
contains
Returns if binary heap contains the provided node.- Parameters:
node
- May be null.identity
- If true, == comparison will be used. If false, .equals() comparison will be used.
-
peek
-
pop
-
remove
-
isEmpty
public boolean isEmpty()Returns true if the heap is empty. -
clear
public void clear() -
setValue
-
equals
-
hashCode
public int hashCode() -
toString
-