冒泡排序法
1 /// <summary> 2 /// 冒泡排序法-for循环 3 /// </summary> 4 /// <param name="array"></param> 5 private static void BubbleSort(int[] array) 6 { 7 var length = array.Length; 8 for (int i = 0; i < length;i++ ) 9 { 10 for (int j = length-1; j > i; j--) 11 { 12 if (array[j] < array[j - 1]) 13 { 14 int temp = array[j]; 15 array[j] = array[j - 1]; 16 array[j - 1] = temp; 17 } 18 } 19 } 20 }
____你會如何想起我_帶著微笑或是很沉默_
____很多事情錯過了就是錯過了_