一.冒泡排序 function BubbleSort(array) { var length = array.length; for (var i = length - 1; i > 0; i--) { //用于缩小范围 for (var j = 0; j < i> array[j+1]) { var temp = array[j]; array[j] = array[j+1]; array[j+1] = temp;