Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

optimized-quicksort

1.1.1 • Public • Published

optimized-quicksort

Optimized version of quicksort. Dual-pivot implementation with insertion sort optimization.

npm version License: MIT

Installation

$ npm install optimized-quicksort

Quick start

var Quicksort = require('optimized-quicksort');
 
function myCompareFn(a, b) {
    if (< b) return -1;
    else if (> b) return 1;
    else return 0;
}
 
var array = [1,9,2,8,3,7,4,6,5];
Quicksort.sort(array, myCompareFn);

Performance

npm run performance
 
Sort 1000 tables each 10000 elements
Quicksort time: 761ms
Array.sort() time: 1972ms

Licence

MIT

Install

npm i optimized-quicksort

DownloadsWeekly Downloads

5

Version

1.1.1

License

MIT

Unpacked Size

5.78 kB

Total Files

5

Last publish

Collaborators

  • avatar