Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pangiole/algojs-collections
It provides Javascript implementation of fundamental collections.
https://github.com/pangiole/algojs-collections
Last synced: about 1 month ago
JSON representation
It provides Javascript implementation of fundamental collections.
- Host: GitHub
- URL: https://github.com/pangiole/algojs-collections
- Owner: pangiole
- License: unlicense
- Created: 2016-03-01T23:53:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-03T18:12:20.000Z (almost 9 years ago)
- Last Synced: 2024-09-25T09:27:40.408Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 482 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# algojs-collections
Fundamental data structures in Javascript.[![npm version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]
## API docs
API docs published here.### List
An highly optimized immutable linked list which grows by prepending elements.```javascript
var algojs = require('algojs-collections');var list1 = new algojs.List();
var list3 = new algojs.List('is', 'nice');// prepend an element
var list4 = list3.cons('bike');
var list2 = list1.cons('a').cons('Riding');// prepend a prefix list
var list5 = list4.concat(list2);var println = function(elem) { console.log(elem); };
list5.foreach(println);
```### Stack
A mutable stack which grows like a linked list```javascript
var algojs = require('algojs-collections');var stack = new algojs.Stack();
stack.push('hello');
stack.push('folks');var folks = stack.pop();
```[npm-image]: https://badge.fury.io/js/algojs-collections.svg
[npm-url]: https://badge.fury.io/js/algojs-collections[travis-image]: https://travis-ci.org/angiolep/algojs-collections.svg?branch=master
[travis-url]: https://travis-ci.org/angiolep/algojs-collections[coveralls-image]: https://coveralls.io/repos/github/angiolep/algojs-collections/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/angiolep/algojs-collections?branch=master