Visualizer extracting the most priority element from the binary heap
About algorithm
- Swap first and last element of the heap
- Delete last element from heap
-
Run the sift down process from vertex 1
- Calculate the min value from left and right son
- If value in current vertex(from which function is launched) bigger than min of sons,
swap these values and run function sift down from the lowest son
- Otherwise heap is balanced