public static void insertionSort(int[] a) { int i, j, k, temp; for (i = 1; i < a.length; i++) { temp = a[i]; j = i - 1; while (j >= 0 && temp < a[j]) { a[j + 1] = a[j]; j--; } a[j + 1] = temp; } }