For this exercise you must get the tests to pass.
Given the following constructor function
function MaxBinaryHeap(val){
this.values = [];
}
Implement the insert
function on the MaxBinaryHeap.prototype
: This function should insert a node in a binary heap. Make sure to re-order the heap after insertion if necessary
Implement a function called checkMaxHeap. It should check if an array is a valid Max Heap and return true or false.
Given an array of numbers, implement a function called maxHeapify
which converts an array of numbers into a max-heap. Note that this function assumes a correct implentation of checkMaxHeap.
Implement the remove
function on the MaxBinaryHeap.prototype
This function should remove the root node in a binary heap. Make sure to re-order the heap after removal if necessary