Skip to content

hechangmin/jssort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#常见排序-JS 实现

仅供学习参考,切勿采用。因为javascript array 之sort 经过脚本引擎优化,性能往往比自己写的好。


  • 常见排序
    • 冒泡排序
    • 选择排序
    • 快速排序
    • 插入排序
    • 希尔排序

Test 验证

var arr = [1,2,3,56,34,2,20,12];
console.log(Sort.quick(arr));

var arr1 = [1,2,3,56,34,2,20,12];
console.log(Sort.bubble(arr1));

var arr2 = [1,2,3,56,34,2,20,12];
console.log(Sort.selection(arr2));

var arr3 = [1,2,3,56,34,2,20,12];
console.log(Sort.insertion(arr3));

var arr4 = [1,2,3,56,34,2,20,12];
console.log(Sort.shell(arr4));

欢迎联系我 hechangmin@gmail.com

About

常见排序算法-js版本

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published