A JavaScript Data Structure Library
Buckets is a complete, fully tested and documented data structure library written in pure JavaScript.
- Linked List
- Dictionary
- Multi Dictionary
- Binary Search Tree
- Stack
- Queue
- Set
- Bag
- Binary Heap
- Priority Queue
Buckets also includes several functions for manipulating arrays.
- Every desktop and mobile browser (including IE6)
- Node.js
If it supports JavaScript, it probably supports buckets.
Download
- buckets.js (for development) or
- buckets-minified.js (for production)
Include the script and start coding. For NodeJS: var buckets = require('buckets.js')
.
Example
var setA = new buckets.Set();
var setB = new buckets.Set();
setA.add(1);
setB.add(2);
setA.union(setB); // {1,2}
Read the documentation.
Mauricio Santos, mauriciosantoss@gmail.com