UNPKG

@panyam/priorityq

Version:

A Priority Queue implementation with O(1) lookups for lookup by value.

21 lines (20 loc) 639 B
import { Handle, Storage } from "./storage"; declare class ListPQHandle<T> implements Handle<T> { value: T; index: number; constructor(value: T, index: number); } export declare class ListStorage<T> extends Storage<T> { private handles; get size(): number; clear(): void; adjust(_handle: ListPQHandle<T>): void; get isEmpty(): boolean; get top(): ListPQHandle<T>; push(value: T): ListPQHandle<T>; pop(): ListPQHandle<T>; remove(handle: ListPQHandle<T>): ListPQHandle<T>; get sortedHandles(): IterableIterator<ListPQHandle<T>>; get minIndex(): [number, ListPQHandle<T>]; } export {};