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

    Function add

    • Adds a new element to the min-heap while maintaining the heap property. The element is initially added at the end and then heapified up as needed. An element the heap already holds is ignored, and the heap is unchanged.

      Type Parameters

      • H extends IHeapArray

        The type of min-heap array.

      Parameters

      • instance: H

        The min-heap instance.

      • node: H[number]

        The new element to add.

      Returns void