selectionsort:时间复杂度为 O(n^2) 的选择排序

时间:2021-07-03 10:31:08
【文件属性】:
文件名称:selectionsort:时间复杂度为 O(n^2) 的选择排序
文件大小:4KB
文件格式:ZIP
更新时间:2021-07-03 10:31:08
JavaScript 基于时间复杂度为 O(n^2) 的。 安装 $ npm install --save selectionsort 用法 var selectionsort = require ( 'selectionsort' ) ; selectionsort ( [ 6 , 4 , 9 , 3 , 1 , 7 ] ) ; // => [1,3,4,6,7,9] selectionsort ( [ 5 , 1 , 12 , - 5 , 16 , 2 , 12 , 14 ] ) ; // => [-5, 1, 2, 5, 12, 12, 14, 16] selectionsort ( [ 6 , 4 , 9 , 3 , 1 , 7 ] , function ( a , b ) { return b - a ; } ) ; // => [9,7,6,4,3,1] 执照 麻省理工学院 :copyright:

网友评论