@Test public void test() { Insert.Sort(CommonData.OUT_OF_ORDER_ARRAY); for (int a : CommonData.OUT_OF_ORDER_ARRAY) { System.out.println(a); } }
public static void Sort(int[] array) { for (int i = 1; i < array.length; i++) { int j = i - 1; int temp = array[i]; while (j >= 0 && temp < array[j]) { array[j+1]=array[j]; j--; } array[j+1]=temp; } }
Insert { public static void Sort(int[] array) { for (int i = 1; i < array.length; i++) { int j = i - 1; int temp = array[i]; while (j >= 0 && temp < array[j]) { array[j+1]=array[j]; j--; } array[j+1]=temp; } } }
Insert { public static void Sort(int[] array) { for (int i = 1; i < array.length; i++) { int j = i - 1; int temp = array[i]; while (j >= 0 && temp < array[j]) { array[j+1]=array[j]; j--; } array[j+1]=temp; } }  }
Insert { public static void Sort(int[] array) { for (int i = 1; i < array.length; i++) { int j = i - 1; int temp = array[i]; while (j >= 0 && temp < array[j]) { array[j+1]=array[j]; j--; } array[j+1]=temp; } }  static void Sort(int[] array); }
Insert { public static void Sort(int[] array) { for (int i = 1; i < array.length; i++) { int j = i - 1; int temp = array[i]; while (j >= 0 && temp < array[j]) { array[j+1]=array[j]; j--; } array[j+1]=temp; } }  static void Sort(int[] array);  }