An implementation of Quicksort in JavaScript.
A walkthrough of the logic behind Quicksort and development of this package can be found on the Medium article Implementing Quicksort in JavaScript.
Install
npm install @charlesstover/quicksort --save
oryarn add @charlesstover/quicksort
Examples
import quickSort from '@charlesstover/quicksort';
import { expect } from 'chai';
describe('Quicksort', () => {
it('should sort an array', () => {
const unsorted = [ 5, 4, 1, 3, 2 ];
const sorted = quickSort(unsorted);
expect(sorted).to.deep.equal([ 1, 2, 3, 4, 5 ]);
});
});