Package pfvisualizer.data
Interface Heap
-
- All Known Implementing Classes:
BinaryHeap
public interface Heap
-
-
Field Summary
Fields Modifier and Type Field Description static intINITIAL_CAPACITYThe initial capacity of the heap.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeextractMin()Removes and returns the min node.voidinsert(Node node)Inserts a node into the heap.booleanisEmpty()Checks if the heap is empty of not.
-
-
-
Field Detail
-
INITIAL_CAPACITY
static final int INITIAL_CAPACITY
The initial capacity of the heap.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
boolean isEmpty()
Checks if the heap is empty of not.- Returns:
- true if the heap is empty and false if it is not
-
insert
void insert(Node node)
Inserts a node into the heap.- Parameters:
node- node to be inserted
-
extractMin
Node extractMin()
Removes and returns the min node.- Returns:
- the min node
-
-