Package pfvisualizer.data
Class BinaryHeap
- java.lang.Object
-
- pfvisualizer.data.BinaryHeap
-
-
Field Summary
-
Fields inherited from interface pfvisualizer.data.Heap
INITIAL_CAPACITY
-
-
Constructor Summary
Constructors Constructor Description BinaryHeap()A min heap for Node objects (sorted by heuristic).
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Description copied from interface:HeapChecks if the heap is empty of not.
-
insert
public void insert(Node node)
Description copied from interface:HeapInserts a node into the heap.
-
extractMin
public Node extractMin()
Description copied from interface:HeapRemoves and returns the min node.- Specified by:
extractMinin interfaceHeap- Returns:
- the min node
-
-