import type { Comparator } from "@rickosborne/typical"; import type { Queue } from "./queue.js"; /** * Simple implementation of a binary min-heap, meaning low * values are sorted before high values, using the supplied * comparator. Invert your comparator if you want a max-heap. */ export declare class ArrayBinaryMinHeap implements Queue { private readonly comparator; private count; private readonly items; constructor(comparator: Comparator); get length(): number; get unsorted(): T[]; add(value: T): void; addAll(values: Iterable): void; protected down(index: number): void; protected minChild(index: number): number; peek(): T | undefined; remove(item: T): void; private removeAt; sort(): void; take(): T | undefined; toArray(): T[]; protected up(index: number): void; values(): Generator; protected valuesAndIndexes(): Generator<[T, number], void, undefined>; } /** * Build a min-heap using the given comparator. */ export declare const arrayBinaryMinHeap: (comparator: Comparator) => ArrayBinaryMinHeap; /** * Build a max-heap using the given comparator. Will invert the * comparator and build a min-heap, which produces the same * outcomes. */ export declare const arrayBinaryMaxHeap: (comparator: Comparator) => ArrayBinaryMinHeap; //# sourceMappingURL=binary-heap.d.ts.map