private static void insertSort(int[] array) { for (int i = 0; i < array.length; i++) { int j=i; for (int k = i - 1; k >= 0; k--) { if (array[j] < array[k]) { int key = array[j]; array[j] = array[k]; array[k] = key; j--; } } } }