1.0.3 • Published 4 years ago

bubblesort-one-loop v1.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

NPM version

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