C#插入法排序算法代码
public static void InsertSort (int[] list) { for (int i = 1; i < list.Length; i++) { int Temp = list [i]; int j = i - 1; while (j > = 0 && list [j] > Temp) { list [j + 1] = list [j]; j-; } list [j + 1] = Temp; } }
C#插入法排序算法代码
public static void InsertSort (int[] list) { for (int i = 1; i < list.Length; i++) { int Temp = list [i]; int j = i - 1; while (j > = 0 && list [j] > Temp) { list [j + 1] = list [j]; j-; } list [j + 1] = Temp; } }