ts-ds-tool
a tool library of Data Structure and Algorithms based on typescript
npm install ts-ds-tool --save
Use the script tags in the browser to directly import the file and use the global variable DataStructure. We provide files such as ts-ds-tool/data-structure.min.js in the ts-ds-tool/dist
directory in the npm package, or via unpkg Download it.
<script src="https://unpkg.com/ts-ds-tool/dist/data-structure.min.js"></script>
- Linked List โ
- Double Linked List โ
- Cycle Linked List โ
- Queue โ
- Stack โ
- Skip List โ
- Max Heap โ
- Min Heap โ
- Priority Queue โ
- Binomial Heap โ
- Leftist Tree โ
- HashTable โ
- HashMap โ
- HashSet โ
- Tree Map โ
- Tree Set โ
- Disjoint Set โ
- Basic Binary Tree โ
- Binary Search Tree โ
- AVL Tree โ
- Red Black Tree โ
- Fenwick Tree โ
- Huffman Tree โ
- Graph โ
- binary search โ
- longest common sequence โ
- kmp โ
- levenshtein distance โ
- max sub array โ
- min and max โ
- bellman ford โ
- dijkstra โ
- floyd warshall โ
- breadth first search โ
- depth first search โ
- isconnected โ
- isEulerGraph โ
- getEulerCircuit โ
- kruskal โ
- prim โ
- tarjan โ
- topo-sort โ
- tsp branch and bound โ
- gcd โ
- lcm โ
- combination โ
- combination repeat โ
- permutation โ
- power set โ
- bubble sort โ
- insert sort โ
- merge sort โ
- quick sort repeat โ
- selection sort โ
- shell sort โ
import { Queue } from 'ts-ds-tool';
import { breadthFirstSearch } from 'ts-ds-tool';
import { sort } from 'ts-ds-tool';
import { math } from 'ts-ds-tool';
sort.quickSort([3,2,1]);
math.gcd(9, 6);
$ git clone git@github.com:HaifengDu/ts_ds_tool.git
$ cd ts_ds_tool
$ npm install
This will setup the library dependencies for you.
To run tests, run
$ npm run test
To lint your code, run
$ npm run lint
To generate test coverage, run
$ npm run ci
To compile typescript, run
$ npm run tsc
To only build, run
$ npm run build:dist
To compile and build, run
$ npm run build
This project is licensed under the MIT License.