npm version code style: prettier

Typed-Ds-Algs

Data Structures in TypeScript!

Prerequisites

This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
6.4.1
v8.16.0

Table of contents

Installation

BEFORE YOU INSTALL: please read the prerequisites

To install and set up the library, run:

$ npm install -S typed-ds-algs

Or if you prefer using Yarn:

$ yarn add --dev typed-ds-algs

Data Structures

Stack

Method Parameters Return Type
isEmpty N/A boolean
isFull N/A boolean
push item : T void
pop N/A T
peek N/A T
getStack N/A T[]
const stack = new Stack<number>();
stack.push(3);
stack.push(2);
stack.pop();

const top = stack.peek();

Queue

Method Parameters Return Type
isEmpty N/A boolean
isFull N/A boolean
enqueue item : T void
dequeue N/A T
peek N/A T
getQueue N/A T[]

Example:

const queue = new Queue<number>();
queue.enqueue(3);
queue.enqueue(2);
queue.dequeue();

const front = queue.peek();

BinarySearchTree

Type Default value
string ''

Example:

BlockChain

Type Default value
string ''

Example:

Contributing

Please read CONTRIBUTING.md for the process for submitting pull requests.

  1. Fork it!
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Add your changes: git add .
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request!

Built With

  • TypeScript
  • Love

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See the list of contributors who participated in this project.

License

MIT License © Connor Pawar