Package com.github.tommyettinger.ds
Class BinaryHeap.Node
java.lang.Object
com.github.tommyettinger.ds.BinaryHeap.Node
- Enclosing class:
- BinaryHeap<T extends BinaryHeap.Node>
A binary heap node. Has a float value that is used to compare this Node with others,
and an int index that is used inside BinaryHeap. This class is often extended so
requisite functionality can be supplied and sorted by BinaryHeap.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
public float valueThe value that is used to compare this Node with others. -
index
public int indexUsed internally by BinaryHeap; generally not modified by external code, but may need to be read.
-
-
Constructor Details
-
Node
public Node(float value) - Parameters:
value- The initial value for the node. To change the value, useBinaryHeap.add(Node, float)if the node is not in the heap, orBinaryHeap.setValue(Node, float)if the node is in the heap.
-
-
Method Details