Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

closure-heap

nornagon20Apache-2.01.0.0

Heap implementation extracted from Google Closure

readme

closure-heap

This is an implementation of a Heap datastructure. Smaller keys rise to the top.

This implementation is extracted from the Google Closure Library.

Usage

const Heap = require('closure-heap')

const h = new Heap
h.insert(3, 'sheep')
h.insert(1, 'goat')
h.insert(2, 'chicken')

console.log(h.remove())
// => goat

See the Closure docs (or take a look at the source) for additional documentation.