Giter Club home page Giter Club logo

data-structures-ts's Introduction

Data Structures

๐Ÿ›ข Codes containing implementation of data structures in Typescript.

GitHub license made-with-typescript

Requirements

This application requires the following resources:

Optional:

Getting started

After having the project cloned on your computer and opening the folder, you must install the dependencies.

With yarn: run the following command in your project clone

yarn 

With npm:

npm install

Usage example

The classes of the algorithms have already been instantiated in the file src/main.ts. You can change this implementation if you want.

import Stack from './algorithms/stack';
import Queue from './algorithms/queue';
import Deck from './algorithms/deck';
import binarySearch from './algorithms/binarySearch';

const InstantiatedStack = new Stack();
const InstantiatedQueue = new Queue();
const InstantiatedDeck = new Deck();


InstantiatedStack.push(5, 6, 7, 8, 9);

console.log(InstantiatedStack.showStack()); // [5, 6, 7, 8, 9]
InstantiatedStack.pop(); // 9 
console.log(InstantiatedStack.showStack()); // [5, 6, 7, 8]

InstantiatedQueue.enqueue(12);
InstantiatedQueue.enqueue(55);
InstantiatedQueue.enqueue(9);

console.log(InstantiatedQueue.showQueue()); // [12, 55, 9]
InstantiatedQueue.dequeue(); // 12
console.log(InstantiatedQueue.showQueue()); // [55, 9]

InstantiatedDeck.addBack(6);
InstantiatedDeck.addFront(3);

console.log(InstantiatedDeck.showDeck());  // [3, 6]

console.log(binarySearch([67, 69, 70, 85, 100, 102, 254, 800], 70)); // 70

With yarn:

yarn start

Wiht npm:

npm run start

Meta

Leonardo Oliveira โ€“ @leozartino โ€“ [email protected]

Distributed under the MIT license. See MIT for more information.

Contributing

Feel free to contribute by adding other data structure algorithms using typescript. Add the files in the folder src/algorithms.

  1. Fork it (https://github.com/Leozartino/data-structures-ts/fork)
  2. Create your feature branch (git checkout -b feature/newFeature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/newFeature)
  5. Create a new Pull Request

Auhors

  • Leonardo de Andrade Oliveira (leozartino) - Javascript Developer Made with ๐Ÿ’œ

data-structures-ts's People

Contributors

leozartino avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.