Efficient Binary heap (priority queue, binary tree) data structure for JavaScript / TypeScript. Includes JavaScript methods, Python's heapq module methods, and Java's PriorityQueue methods.
Changelog:
HeapAsync
class, with async methods and supporting async comparators. It is a drop-in replacement for the Heap
class with Promises.100% test coverage.
Quick changelog:
The Iterator provided in method iterator() is not guaranteed to traverse the elements of the priority queue in any particular order.
Quick changelog:
A test is fixed and all the dependencies are up to date.
The main breaking change is that now top(N) does NOT sort the output. It should not be part of the spec for a priority queue, the output should be the top N elements. It will be partially ordered with the peek at index 0 by definition, that is all.
Dependencies upgrade.
The main breaking change is that now top(N)
does NOT sort the output. It should not be part of the spec for a priority queue, the output should be the top N elements. It will be partially ordered by definition, that is all.
Update deps and 100% coverage