tiny-binary-heap

1.1.0 • Public • Published

tiny-binary-heap

Tiny binary heap with no dependencies

npm install tiny-binary-heap

Usage

const Heap = require('tiny-binary-heap')

const h = new Heap(cmp) // cmp defaults to a < b ? -1 : a > b ? 1 : 0

h.push(42) // insert a value
h.shift() // shift the next sorted value
h.peek() // look at the next sorted value
h.length // how many values are in the heap?

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    123
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    123
  • 1.0.0
    0

Package Sidebar

Install

npm i tiny-binary-heap

Weekly Downloads

123

Version

1.1.0

License

MIT

Unpacked Size

4.74 kB

Total Files

6

Last publish

Collaborators

  • mafintosh