import { Comparator } from "../../types/comparator"; export declare class BinaryHeap { private items; /** * a comparator function that determines if an item should be moving up the heap * it receives the current item and the parent item. */ comparator: Comparator; get size(): number; constructor(comp: Comparator); /** * Adds a value to the heap * @param value the value to add */ insert(value: T): void; /** * goes through the heap and makes sure every element is in place according to a comparator function. * @param comparator an optional comparator to override the default. */ heapify(comparator?: Comparator): void; /** * Removes the head of the heap * @returns {T} the removed element. */ extractHead(): T; /** * goes through the heap after the head is removed and makes sure everything is in place. */ private drillDown; /** * returns the index of the parent of the passed child * @param index the index of the child */ parentOf(index: number): number; /** * returns an array of indices of the children of a specific parent. * @param index the index of the parent */ childrenOf(index: number): number[]; /** * returns the index of the child which should be compared with during the drill down operation. * @param index the index of the current item */ private nextChildToDrill; asArray(): T[]; }