经典算法之冒泡排序c#
public static int[] BubbleSort(int[] array) { int length = array.Length; for (int i = 0; i <= length - 1; i++) { for (int j = length - 1; j > i; j--) { if (array[j] < array[j - 1]) { int temp = array[j]; array[j] = array[j - 1]; array[j - 1] = temp; } } } return array; }