median-heap
get the median of a sequence of numbers
Installation
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install median-heap
API
var Heap = ; var heap = ;heap;heap;heap; heap;// => 2
Using a custom comparison function
var Heap = ; var heap = { return bage - aage;}; var people = name: 'foo' age: 23 name: 'bar' age: 24 name: 'baz' age: 99 forvar i=0; i < peoplelength; i++ heap; heapname;// => bar