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