Table of Contents generated with DocToc
ljzjs
javascript sort function, include bubble sort, insert sort, quick sort
usage
'use strict';var bubble = bubbleSort;var insert = insertSort;var quick = quickSort;var shell = shellSort;var arr = 1 4 2 7 9 6 5 10 3 100 102 101 23 34 45 43 32 4;console;console;console;console;
$ bubble => [ 1, 2, 3, 4, 4, 5, 6, 7, 9, 10, 23, 32, 34, 43, 45, 100, 101, 102 ]$ insert => [ 1, 2, 3, 4, 4, 5, 6, 7, 9, 10, 23, 32, 34, 43, 45, 100, 101, 102 ]$ quick => [ 1, 2, 3, 4, 4, 5, 6, 7, 9, 10, 23, 32, 34, 43, 45, 100, 101, 102 ]$ shell => [ 1, 2, 3, 4, 4, 5, 6, 7, 9, 10, 23, 32, 34, 43, 45, 100, 101, 102 ]
test
$ npm test
TODO
- more sort function, comb sort ...