• Returns an iterator for traversing the min-heap elements.

    Type Parameters

    Parameters

    • instance: H

      The min-heap instance.

    • Optionalreversed: boolean = false

      If true, the iterator will traverse the min-heap in reverse order.

    Returns Generator<H[0], void, unknown>

    A generator that yields min-heap elements in the provided order.