项目作者: rickyes

项目描述 :
☆ Basic high-level data structure library for Node.js
高级语言: JavaScript
项目地址: git://github.com/rickyes/lucky.js.git
创建时间: 2018-09-06T07:00:41Z
项目社区:https://github.com/rickyes/lucky.js

开源协议:MIT License

下载


lucky.js

Basic high-level data structure library for Node.js, inspired by Java

Travis
Node Version
npm
Codecov

Install

  1. $ npm i lucky.js --save

Features

  • LinkedList 链表
  • HashMap 哈希
  • RedBlackTree 红黑树
  • MinimumHeap 最小堆
  • AVLTree
  • BTree B+树

API

See the detailed API Reference.

Example

  1. 'use strict';
  2. const {LinkedList, HashMap} = require('lucky.js');
  3. const linkedList = new LinkedList();
  4. const hashMap = new HashMap();
  5. // LinkedList
  6. linkedList.add('one');
  7. linkedList.add('two');
  8. const topValue = linkedList.peek(); // one
  9. // HashMap
  10. hashmap.put('one', 1);
  11. const value = hashmap.get('one'); // 1
  12. const oldValue = hashmap.replace('one', 1); // null

Author

Lucky.js © Ricky 泽阳, Released under the MIT License.