@darkblue_azurite/heap

1.0.6 • Public • Published

Heap

Build Status dependencies Status npm version

A binary heap data structure written in Javascript

Installation

For node.js:

npm install --save @darkblue_azurite/heap

then require it:

var Heap = require("@darkblue_azurite/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

Readme

Keywords

Package Sidebar

Install

npm i @darkblue_azurite/heap

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

32.7 kB

Total Files

13

Last publish

Collaborators

  • darkblue_azurite