0.0.4 • Published 6 years ago
lucky.js v0.0.4
lucky.js
Basic high-level data structure library for Node.js, inspired by Java
Install
$ npm i lucky.js --save
Features
- LinkedList
- HashMap
- DoubleLinkedList
- CycleLinkedList
- BinaryTree
- RedBlackTree
- AVLTree
- BTree
- BPlusTree
- Graph
API
See the detailed API Reference.
Example
'use strict';
const {LinkedList, HashMap} = require('lucky.js');
const linkedList = new LinkedList();
const hashMap = new HashMap();
// LinkedList
linkedList.add('one');
linkedList.add('two');
const topValue = linkedList.peek(); // one
// HashMap
hashmap.put('one', 1);
const value = hashmap.get('one'); // 1
const oldValue = hashmap.replace('one', 1); // null
Author
Lucky.js © Ricky 泽阳, Released under the MIT License.