Skip to content

cheerfyt/ljzjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ...

About

javascript sort function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published