public static void selectSort(int[] a){ int minIndex, temp; int len = a.length; for (int i = 0; i < len - 1; i++){ minIndex = i; for (int j = i + 1; j < len; j++){ if (a[j] < a[minIndex]){ minIndex = j;} } temp = a[i]; a[i] = a[minIndex]; a[minIndex] = temp; } }