typed-ds-algs
v0.3.0
Published
Messing around with implementing data structures in typescript
Downloads
4
Maintainers
Readme
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
- Prerequisites
- Table of contents
- Installation
- Data Structures
- Contributing
- Built With
- Versioning
- Authors
- License
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.
- Fork it!
- Create your feature branch:
git checkout -b feature/my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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
- Connor Pawar - Initial work - connorpawar
See the list of contributors who participated in this project.
License
MIT License © Connor Pawar