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

    Interface IHeapNode

    An interface representing a node in the binary heap data structure. Each node must have a numeric key that determines its position in the heap.

    interface IHeapNode {
        key: number;
    }
    Index
    key: number

    The numeric key value used for heap ordering.

    • Lower values have higher priority in a min-heap,
    • higher values have higher priority in a max-heap.

    Expected to be a number other than NaN; Infinity and -Infinity order as expected. Nothing validates this: a key is only ever compared with <, >, <= and >=, so one of another type is ordered by whatever those return for it, and a NaN by nothing at all.

    Must be writable for a node passed to increase or decrease, which assign to it. TypeScript accepts a readonly key here, so a frozen node or a getter without a setter type-checks, and those calls then throw a TypeError.