selectionsort

Selection sort with O(n^2) time complexity

Downloads
6
Stars
56
Committers
4

NPM version Build Status Dependency Status

Selection sort with O(n^2) time complexity based on javascript-algorithms.

Install

$ npm install --save selectionsort

Usage

var selectionsort = require('selectionsort');

selectionsort([6,4,9,3,1,7]); 
// => [1,3,4,6,7,9]

selectionsort([5, 1, 12, -5, 16, 2, 12, 14]);
// => [-5, 1, 2, 5, 12, 12, 14, 16]

selectionsort([6,4,9,3,1,7], function(a, b) { return b - a; }); 
// => [9,7,6,4,3,1]

License

MIT © Addy Osmani

Package Rankings
Top 25.19% on Npmjs.org
Badges
Extracted from project README
NPM version Build Status Dependency Status