import { BinaryHeap } from "https://deno.land/x/collections@v0.9.0/binary_heap.ts";
A priority queue implemented with a binary heap. The heap is in decending order by default, using JavaScript's built in comparison operators to sort the values.
Constructors
new
BinaryHeap(compare?: compare<T> | compareDefined<T>)Properties
private
data: T[]Methods
[Symbol.iterator](): IterableIterator<T>
Static Methods
from<T, U>(collection: ArrayLike<T> | Iterable<T>): BinaryHeap<U>
Creates a new binary heap from an array like or iterable object.
from<T, U>(collection: ArrayLike<T> | Iterable<T>, options: { compare?: compare<U> | compareDefined<U>; }): BinaryHeap<U>
from<T, U, V>(collection: ArrayLike<T> | Iterable<T>, options: { compare?: compare<U> | compareDefined<U>; map: mapDefined<T, U>; thisArg?: V; }): BinaryHeap<U>