Insertion sort
Complexity : worst : n2 , average n2 , best n where n is the number of elements in the given array
Fast algorithm if the array contain a maximum of 15 elements.
var insertion = insertion; var array = 4 6 3 7 1 9 2 ; ;// return [ 1 , 2 , 3 , 4 , 6 , 7 , 9 ]
Insertion Synchronous sort
Same as insertion sort but the synchronous way
var insertionSyncSort = insertionSync; var array = 4 6 3 7 1 9 2 ; ;// return [ 1 , 2 , 3 , 4 , 6 , 7 , 9 ]
Quick sort
Complexity : worst : n2 , average n log n , best n log n where n is the number of elements in the given array
cf : wiki Quick sort
var quickSort = quick; var array = 4 6 3 7 1 9 2 ; ;// return [ 1 , 2 , 3 , 4 , 6 , 7 , 9 ]
Quick sort Synchronous
Same as quick sort but the synchronous way
var quickSyncSort = quickSync; var array = 4 6 3 7 1 9 2 ; ;// return [ 1 , 2 , 3 , 4 , 6 , 7 , 9 ]