1.0.0 • Published 4 years ago
closure-heap v1.0.0
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.
1.0.0
4 years ago