UNPKG

@panyam/priorityq

Version:

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

24 lines 541 B
export class Storage { constructor(cmpFunc) { this._cmpFunc = cmpFunc; } heapify(values) { for (const value of values) { this.push(value); } } get comparator() { return this._cmpFunc; } set comparator(cmpFunc) { this._cmpFunc = cmpFunc; const handles = this.sortedHandles; this.clear(); for (const handle of handles) { this.push(handle.value); } } adjust(_handle) { } } //# sourceMappingURL=storage.js.map