Addressable Binary Heaps - v1.3.0
    Preparing search index...

    Function peek

    • Returns the maximum element (root) of the max-heap without removing it.

      Type Parameters

      • H extends IHeapArray

        The type of max-heap array.

      Parameters

      • instance: H

        The max-heap instance.

      Returns H[number] | undefined

      The maximum element or undefined if heap is empty.