bubblesort-one-loop
v1.0.3
Published
Bubble Sort with one loop
Downloads
8
Maintainers
Readme
Bubble Sort with one loop, still with O(n^2) complexity.
Why
Why not?
Install
$ npm i --save bubblesort-one-loop
Usage
var bubblesort = require('bubblesort-one-loop');
bubblesort([5,4,3,2,1]); // => [1,2,3,4,5]
function cmp(a, b) { return b - a; }
bubblesort([1,2,3,4,5], cmp); // => [5,4,3,2,1]
License
MIT © Catalin Stochita