function insertionSort(items) { var len = items.length; for (var i = 0; i < len; i++) { var value = items[i]; for (var j = i-1; j > -1 && items[j] > value; j--) { //内层循环是什么意思?代码不明白 console.log(i,j,items[j]); items[j+1] = items[j]; } items[j+1] = value; } return items;};
添加回答
举报
0/150
提交
取消