摘要:
function insertionSort(array) { if (Object.prototype.toString.call(array).slice(8, -1) 'Array') { console.time('插入排序耗时:'); for (var i = 1; i < array.l 阅读全文
摘要:
function selectionSort(arr) { var len = arr.length; var minIndex, temp; console.time('选择排序耗时'); for (var i = 0; i < len - 1; i++) { minIndex = i; for 阅读全文