1.0.4 • Published 8 years ago

@markon95/heap v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

Heap

Build Status dependencies Status npm version

A binary heap data structure written in Javascript

Installation

For node.js:

npm install --save @markon95/heap

then require it:

var Heap = require("@markon95/heap");

To use the library directly in the browser, copy the heap.js file from the lib directory into your project and include it in your webpage. heap.min.js provides you with a minified version. The files in the lib directory are also transpiled to es5.

<script type="text/javascript" src="./heap.js"></script>
<script type="text/javascript">
  var heap = new Heap(); // available as a global
</script>

Example usage

var heap = new Heap();

heap.push(5)
  .push(2)
  .push(1)
  .push(3)
  .push(8);

var arr = heap.toArray(); // [1, 3, 2, 5, 8]

Documentation

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago