Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mauriciosantos/Buckets-JS
A complete, fully tested and documented data structure library written in pure JavaScript.
https://github.com/mauriciosantos/Buckets-JS
bag binary-heap binary-search binary-search-tree collection collections data-structures dictionary javascript linked-list map multimap priority-queue queue set stack tree tree-structure
Last synced: 2 months ago
JSON representation
A complete, fully tested and documented data structure library written in pure JavaScript.
- Host: GitHub
- URL: https://github.com/mauriciosantos/Buckets-JS
- Owner: mauriciosantos
- License: mit
- Created: 2011-12-29T12:15:06.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2020-12-21T23:37:28.000Z (about 4 years ago)
- Last Synced: 2024-10-29T23:51:57.273Z (2 months ago)
- Topics: bag, binary-heap, binary-search, binary-search-tree, collection, collections, data-structures, dictionary, javascript, linked-list, map, multimap, priority-queue, queue, set, stack, tree, tree-structure
- Language: JavaScript
- Homepage:
- Size: 1.37 MB
- Stars: 1,250
- Watchers: 43
- Forks: 112
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs-pure-js - Buckets-JS(collections)
- awesome-javascript - Buckets-JS - A complete, fully tested and documented data structure library written in pure JavaScript. - ★ 904 (Data Structure)
README
# [Buckets](https://github.com/mauriciosantos/buckets/)
[![Build Status](https://travis-ci.org/mauriciosantos/Buckets-JS.svg?branch=master)](https://travis-ci.org/mauriciosantos/Buckets-JS)
[![NPM Version](https://img.shields.io/npm/v/buckets-js.svg)](https://img.shields.io/npm/v/buckets-js.svg)**A JavaScript Data Structure Library**
Buckets is a complete, fully tested and documented data structure library written in pure JavaScript.
## Included data structures
- [Linked List](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.LinkedList.html)
- [Dictionary](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Dictionary.html)
- [Multi Dictionary](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.MultiDictionary.html)
- [Binary Search Tree](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.BSTree.html)
- [Stack](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Stack.html)
- [Queue](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Queue.html)
- [Set](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Set.html)
- [Bag](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Bag.html)
- [Binary Heap](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.Heap.html)
- [Priority Queue](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.PriorityQueue.html)Buckets also includes several functions for manipulating [arrays](http://mauriciosantos.github.io/Buckets-JS/symbols/buckets.arrays.html).
## Supported platforms
- Every desktop and mobile browser (including IE6)
- Node.jsIf it supports JavaScript, it probably supports buckets.
## Downloading Buckets
Download directly
- [buckets.js](https://github.com/mauriciosantos/Buckets-JS/releases/latest) (for development) or
- [buckets.min.js](https://github.com/mauriciosantos/Buckets-JS/releases/latest) (for production)Then, add it as a script tag to your page:
```html
var aSet = new buckets.Set();
```
Or install `bucketsjs` using [bower](http://bower.io/)
```shell
bower install bucketsjs
```Or use an [AMD](https://github.com/amdjs/amdjs-api) loader
```javascript
require(["./bower/bucketsjs/buckets.js"], function(buckets) {
var hm = new buckets.Dictionary();
});
```Or install `buckets-js` using [npm](https://www.npmjs.com/)
```shell
npm install buckets-js
```In [Node.js](https://nodejs.org/): `var buckets = require('buckets-js');`.
## Usage
```javascript
var a = new buckets.Set();
var b = new buckets.Set();
a.add(1);
a.add(2);
b.add(2);
a.union(b); // {1,2}
```
Read the [documentation](http://mauriciosantos.github.io/Buckets-JS/).## Building Buckets
There's nothing else you need to use buckets. However, this [guide](./BUILD.md) may help you if you wish to contribute to the project or modify it.