static void InsertSort(int[] array) { for (int i = 1; i < array.Length; i++) { int temp = array[i]; int j = i; while (j > 0 && array[j - 1] > temp) { array[j] = array[j - 1]; j--; } array[j] = temp; } }
posted on 2016-12-28 17:49 虎鲨 阅读(121) 评论(0) 编辑 收藏 举报