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

    Function decrease

    • Decreases the key value of a heap element by a specified amount. The element is rebalanced in whichever direction the new key requires, so a negative amount is handled the same as a positive one.

      Type Parameters

      • H extends IHeapArray

        The type of max-heap array.

      Parameters

      • instance: H

        The max-heap instance.

      • node: H[number]

        The element to modify.

      • decreaseValue: number

        Amount to decrease the key by.

      Returns boolean

      true if element was found and modified, false otherwise.