closure-heap

1.0.0 • Public • Published

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.

/closure-heap/

    Package Sidebar

    Install

    npm i closure-heap

    Weekly Downloads

    1

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    7.5 kB

    Total Files

    3

    Last publish

    Collaborators

    • nornagon