captainAyan / revisiting-javascript

πŸ‘»πŸŽƒThis repo is me trying to go back and learn the basics of JavaScript.πŸ’₯πŸ’€
MIT License
4 stars 8 forks source link

feat: ✨ Added binary search, linear search, insertion sort, marge sort, and selection sort #2

Closed darkling10 closed 2 years ago

darkling10 commented 2 years ago

Hello,I just added an algorithm folder in which there will be two additional folder one for Searching and other for Sorting.This pull request is only to check if everything is good or I have to make some for changes in this.Can you please check this?

captainAyan commented 2 years ago

The code is OK, but I've few suggestions related to formatting,

  1. Change the folder name from Searching to searching
  2. Use prettier to format the code ⭐⭐ 2.1. run npm install (it'll install prettier as a dev dependency) 2.2. run npm run pretty (format the code)
  3. Use this type of comment for documenting,
    /**
    * First Line
    * Second Line
    * Third Line
    */

    So, the first comment should look like this,

    /**
    * Binary Search
    *
    * Geeks for Geeks
    * https://www.geeksforgeeks.org/binary-search/
    *
    * MDN for Recursion
    * https://developer.mozilla.org/en-US/docs/Glossary/Recursion
    */
  4. Line 76 should be -> console.log("Element found at index:"+resultIndex); // Output: Element found at index:7