JavaScript data structures written in CoffeeScript.
npm install data-structures- (Hash) Map
- Heap
- Graph
- (Doubly) Linked List
- Queue
- Self-Balancing Binary Search Tree (Red-Black Tree)
- Trie
``bash`
npm install data-structures
Then where needed:
`js`
var Heap = require('data-structures').Heap;
var heap = new Heap();
heap.add(3);
heap.removeMin();
Alternatively, you can directly use the compiled JavaScript version in the "distribution" folder. It's always in sync with the CoffeeScript one.
`bash`
bower install data-structures
Or if you prefer a more traditional approach, Get the whole file here.
Either use the development version or the minified production version.
Then put the file in your HTML page,
`html`require()
(Magical client-side ) courtesy of Browserify.
The wiki page is a formatted version of the documentation in the code.
`bash`
npm install
Then, with Grunt:
`bash`
grunt test
Feel free to modify the source code and rebuild it for your own needs:
`bash``
grunt
This will take care of compiling CoffeeScript into JavaScript and, if needed, bundle them for the browser.