Counting sort.
JavaScript
Switch branches/tags
Nothing to show
Latest commit efaa55a Jul 23, 2013 @tristanls 0.1.1
Permalink
Failed to load latest commit information.
scripts
.gitignore
LICENSE
README.md
index.js
package.json 0.1.1 Jul 23, 2013
test.js uncommented random descending sort test Jul 23, 2013

README.md

counting-sort

Stability: 1 - Experimental

Counting sort.

Usage

var countingSort = require('counting-sort');
...
var ascending  = countingSort(array);                   // sort ascending
var descending = countingSort(array, undefined, false); // sort descending

Overview

Criteria for using counting sort requires that all inputs be integers from 0 to k, for some integer k.

Counting sort has the fun property of running in O(n) time if it's criteria are met.