Removes and returns the maximum element (root) from the heap. Replaces root with last element and restores heap property.
The type of max-heap array.
The max-heap instance.
The maximum element or undefined if heap is empty.
undefined
Removes and returns the maximum element (root) from the heap. Replaces root with last element and restores heap property.