stalinsort
v1.0.337
Published
Stalinsort-Algorithm [https://new.reddit.com/r/ProgrammerHumor/comments/9s9kgn/nononsense_sorting_algorithm/]
Downloads
11
Readme
Stalinsort
Returns the stalinsorted array.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
My inspiration comes from this great post about a new sorting algorithm with O(n) complexity, and I had to share it so everyone can use this for free, as stalin wished us to share his great invention.
Install
Install with npm:
$ npm install --save is-odd
Usage
Works with strings or numbers.
const sort = require('stalinsort');
console.log(sort([ 10, 5, 11, 14, 12 ])); //=> [ 10, 11, 14 ]
console.log(sort([ 99, 11, 1 ])); //=> [ 99 ]
console.log(sort("Hello")); //=> false
console.log(sort(undefined)); //=> false
About
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test