UNPKG

@panyam/priorityq

Version:

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

28 lines 664 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Storage = void 0; 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) { } } exports.Storage = Storage; //# sourceMappingURL=storage.js.map