Heap Js Versions Save

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.

v2.3.0

1 year ago

Changelog:

  • Adds the HeapAsync class, with async methods and supporting async comparators. It is a drop-in replacement for the Heap class with Promises.

100% test coverage.

v2.2.0

2 years ago

Quick changelog:

The Iterator provided in method iterator() is not guaranteed to traverse the elements of the priority queue in any particular order.

v2.1.6

2 years ago

Quick changelog:

A test is fixed and all the dependencies are up to date.

v2.0.0

3 years ago

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.

  • top(N) is unordered, only the first element is guaranteed to be the top priority element.
  • Fixes custom heap issue #31.
  • Performance improvements.
  • More tests, including those for custom heaps.
  • Auxiliary experimental topN algorithms.
  • (wip) Benchmarks.

v2.1.2

3 years ago

Dependencies upgrade.

v2.0.0-beta.1

4 years ago

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.

v1.6.0-beta.0

4 years ago

v1.6.0-alpha.0

4 years ago
  • Performance improvements.
  • Benchmarks.

v1.5.2

4 years ago

Update deps and 100% coverage