2.1.2 • Published 1 year ago

@darblast/heap v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@darblast/heap

Node.js CI

Provides algorithms to manipulate binary heap arrays.

See https://en.wikipedia.org/wiki/Binary_heap for more information.

Three versions of each function are provided:

  • the ones suffixed with Cmp take an arbitrary comparison function;
  • the ones suffixed with Min use the < operator and result in a min-heap;
  • the ones suffixed with Max use the > operator and result in a max-heap.

The comparison function must be the same across calls to different algorithms on the same array, otherwise the results will be inconsistent. It has the following signature:

export type CompareFn<Element> = (lhs: Element, rhs: Element) => boolean;
2.1.2

1 year ago

2.1.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago