ds-js-x

1.0.15 • Public • Published

ds-js-x

View Documentation

JavaScript Data Structure Library for leetcoding or general use. Currently supports:

  • LinkedList
  • Stack
  • Queue
  • Binary Search Tree
  • Heap (Min & Max)
  • Priority Queue
  • Disjoint Set
  • Segment Tree

Installation

npm i --save ds-js-x

Documentation

View Documentation

Usage

- Imports all data structure:
+ let DS = require('ds-js-x');
+ DS.help();

-Imports BinarySearchTree:
+ let tree = new DS.BinarySearchTree();

-Imports LinkedList:
+ let list = new DS.LinkedList();

- Imports Stack:
+ let stack = new DS.Stack();

- Imports Queue:
+ let queue = new DS.Queue();

- Imports Max Heap:
+ let heap = new DS.PriorityQueue();

- Imports Min Heap:
+ let heap = new DS.PriorityQueue((a, b) => a - b < 0);

- Imports Priority Queue:
+ let queue = new DS.PriorityQueue(comparator);

Development

  • src folder contains the implementation details
    • npm run build to produce build/ folder
    • npm run test to run all testcases
  • build folder contains the version to be published
  • test folder contains integration testing code
    • Download the latest version of ds-js-x
    • Use this package as if you are the actual user

Package Sidebar

Install

npm i ds-js-x

Weekly Downloads

4

Version

1.0.15

License

ISC

Unpacked Size

19.3 kB

Total Files

10

Last publish

Collaborators

  • x65han