import { BinaryHeap } from "https://dotland.deno.dev/std@0.131.0/collections/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.
Properties
private
data: T[]Methods
[Symbol.iterator](): IterableIterator<T>
Static Methods
from<T>(collection: ArrayLike<T> | Iterable<T> | BinaryHeap<T>): BinaryHeap<T>
Creates a new binary heap from an array like or iterable object.
from<T>(collection: ArrayLike<T> | Iterable<T> | BinaryHeap<T>, options: { compare?: (a: T, b: T) => number; }): BinaryHeap<T>
from<T, U, V>(collection: ArrayLike<T> | Iterable<T> | BinaryHeap<T>, options: { compare?: (a: U, b: U) => number; map: (value: T, index: number) => U; thisArg?: V; }): BinaryHeap<U>
from<T, U, V>(collection: ArrayLike<T> | Iterable<T> | BinaryHeap<T>, options?: { compare?: (a: U, b: U) => number; map?: (value: T, index: number) => U; thisArg?: V; }): BinaryHeap<U>