Skip to content

Data structure and algorithm of TypeScript

License

Notifications You must be signed in to change notification settings

rubi-du/ts-ds-tool

This branch is up to date with HaifengDu/ts-ds-tool:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8cd1c98 ยท May 28, 2019

History

46 Commits
Mar 22, 2019
Mar 22, 2019
Jan 14, 2019
Mar 22, 2019
Jan 14, 2019
Jan 16, 2019
Jan 15, 2019
May 28, 2019
Mar 22, 2019
Jan 14, 2019
May 28, 2019
Jan 16, 2019
Jan 16, 2019

Repository files navigation

ts-ds-tool

ts-ds-tool a tool library of Data Structure and Algorithms based on typescript

npm package Build Status codecov

Quick Start

Install

1.Use NPM ( Recommend )

npm install ts-ds-tool --save

2.Import in Browser

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>

Included data structures ๐Ÿ”จ

  • 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 โœ”

Included algorithms ๐Ÿ”จ

  • 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

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);

Run:

$ 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

License ๐Ÿ‘€

This project is licensed under the MIT License.

About

Data structure and algorithm of TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 67.1%
  • JavaScript 32.9%