Giter Site home page Giter Site logo

algorithms-with-es6's Introduction

Algorithms with ES6

This is just a lab to test how classic algorithms written in Ecmascript 6 would look like. The code result is incredible, because it resolves a lot of problems that we used to have while writting Javascript.

The list of Algorithms so far:

Math Expressions

Algorithm Description
factorial Factorial algorithm
fibonacci Fibonacci algorithm
greatestCommonDivisor Get the greatest common divisor of two numbers
isPrime Verify if is a prime number
permutation Permutation algorithm
simpleCombination Simple combination algorithm

Array functions

Algorithm Description
flatten Flatten an array
removeFromArr Remove an item from an array
reverse Reverse an array
removeDuplicates Remove duplicates item in array
concat Concatenate arrays
intersection Intersection between arrays
union Union between arrays

Interview Questions

Algorithm Description
givenSum Get two numbers in an array that the sum is equal a other number that is passed as second parameter
isPalindrome Return if word is a palindrome
reorderByIndexes Reorder an array based on other array with indexes
reverseStr Reverses a given string

You can see the compiled codes at here.

How to run

  1. Make sure to install all modules
$ npm install
  1. After making any changes, add your tests to __tests__ folder and run the test command
$ npm test
  1. To build from ES6 to ES5:
$ gulp build

Enjoy! ๐Ÿ‘ป

algorithms-with-es6's People

Contributors

clupasq avatar pedronauck avatar

Stargazers

 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.