Skip to content

make-github-pseudonymous-again/js-sorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting code bricks for JavaScript.

NPM license NPM version Bower version Build Status Coverage Status Dependencies Status devDependencies Status Code Climate NPM downloads per month GitHub issues

Example usage:

compare = require( "aureooms-js-compare" ) ; sort = require( "aureooms-js-sort" ) ; /** quicksort using hoare partitioning */ quicksort = sort.__quicksort__( sort.hoare ) ; a = [ 1 , 6 , 5 , 3 , 2 , 4 ] ; quicksort( compare.increasing , a , 0 , a.length ) ; a ; // [ 1 , 2 , 3 , 4 , 5 , 6 ] quicksort( compare.decreasing , a , 0 , a.length ) ; a ; // [ 6 , 5 , 4 , 3 , 2 , 1 ] // but also /** binary heapsort */ heapsort = sort.__heapsort__( 2 ) ; /** ternary heapsort */ heapsort = sort.__heapsort__( 3 ) ; /** quicksort (lomuto) */ quicksort = sort.__quicksort__( sort.lomuto ) ; /** dualpivotquicksort (yaroslavskiy) */ quicksort = sort.__dualpivotquicksort__( sort.yaroslavskiy ) ; /** insertionsort */ insertionsort = sort.insertionsort ; /** selectionsort */ selectionsort = sort.selectionsort ; /** bubblesort */ bubblesort = sort.bubblesort ;

Reference: