1.0.5 • Published 7 years ago

ljz v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Table of Contents generated with DocToc

ljzjs

Build Status

javascript sort function, include bubble sort, insert sort, quick sort

usage

'use strict';
var bubble = require("ljz").bubbleSort;
var insert = require("ljz").insertSort;
var quick  = require("ljz").quickSort;
var shell  = require("ljz").shellSort;
var arr = [1, 4, 2, 7, 9, 6, 5, 10, 3, 100, 102, 101, 23, 34, 45, 43, 32, 4];
console.log("bubble => ", bubble(arr));
console.log("insert => ", insert(arr));
console.log("quick => ", quick(arr));
console.log("shell => ", shell(arr));
$ 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 ...
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago