• Removes and returns the top element of the max-heap.

    Type Parameters

    Parameters

    • instance: H

      The max-heap instance.

    Returns undefined | H[0]

    The removed element or undefined if the heap is empty.