Extract the root element and set a new one.
Time complexity: O(logN) Space complexity: O(1)
Add element to the heap
Time complexity: O(logN) Space complexity: O(1)
the size of the heap
Returns the root element without extracting it.
NB: Don't modify if it's an object
Time complexity: O(1) Space complexity: O(1)
Finds the right place for the temporary root
Time complexity: O(logN) Space complexity: O(1)
Overrides the generic toString method
Time complexity: O(n) Space complexity: O(n)
Generated using TypeDoc
Finds the right spot for a newly added element
Time complexity: O(logN) Space complexity: O(1)