quicksortjs
v0.0.5
Published
A quicksort implementation in javascript
Downloads
47
Maintainers
Readme
QuicksortJs
A quicksort implementation in JavaScript.
quicksortjs.sort
is a functional implementation that chooses the first element as the pivot.quicksortjs.sort2
is an imperative approach that chooses a random pivot.
Benchmarks
Firefox (SpiderMonkey):
quicksortjs.sort: 1406.68ms
quicksortjs.sort2: 724.75ms
NodeJS (V8):
$ time cat IntArray.txt | xargs quicksortjs
real 0m2.390s
user 0m1.037s
sys 0m0.087s
$ time cat IntArray.txt | xargs quicksortjs -v2
real 0m2.329s
user 0m0.727s
sys 0m0.077s