sorting-js
Sorting algorithms implemented in JS
How to Install
$ npm install sorting-javascript
Getting Started
ES6 - Use named imports
// Output - [2, 5, 7]
Node.JS require
var sort = sort // Output - [2, 5, 7]
There is an extra utility function called ArrayTestBed which generates random numbers to test the sorting algorithms.
const test = 1000; test // test variable will have 1000 randomly generated numbers between 0-1000
By default, it will contain unique elements. If you pass random = false to the setData function, then the result will contain duplicates. eg:
test // [5, 6, 6, 8, 3, 2, 2] test // [1, 7, 6, 8, 3, 2, 5]
List of sorting algorithms
- Bubble sort
- Counting sort
- Insertion sort
- merge sort
- quick sort
- selection sort
For Geeks :P
How to Test
Run one, or a combination of the following commands to lint and test your code:
$ npm run lint # Lint the source code with ESLint $ npm test # Run unit tests with Mocha $ npm run test:watch # Run unit tests with Mocha, and watch files for changes $ npm run test:cover # Run unit tests with code coverage by Istanbul
To launch the documentation site, run:
$ npm install -g easystatic$ npm start
License
MIT © 2016 Neelesh Roy