js-data-structures
A collection of data structures written in JavaScript.
Detailed information on the complexity of each data structure is located here. To learn more about how some of the data structures are implemented, check out the technical articles on Growing with the Web.
Installing
npm install --save js-data-structures
Including
var AvlTree = AvlTree;var BinaryHeap = BinaryHeap;var BinarySearchTree = BinarySearchTree;var BinomialHeap = BinomialHeap;var FibonacciHeap = FibonacciHeap;var RedBlackTree = RedBlackTree;var SplayTree = SplayTree;
Usage
See the source files and dependencies
in package.json for a list of public interfaces on each data structure, here is an example for the Fibonacci heap.
var heap = ;heap;heap;heap;heap;heap; while !heap console;
Contributing
I'd love to get some contributions for other data structures, if you want to make a pull request try to follow the existing style of the code and make sure you add tests for the new data structure.
Testing locally
npm installnpm test # generate coverage report in ./coverage/ grunt coverage
License
MIT © Daniel Imms