ok ill explain it in words for you.
set min to first value in array.
loop through, if a number is less than min set min to that number
at the end of the array swap the first element in the array...
Type: Posts; User: Freaky Chris
ok ill explain it in words for you.
set min to first value in array.
loop through, if a number is less than min set min to that number
at the end of the array swap the first element in the array...
void selectionSort(int[] a) {
for (int i = 0; i < a.length - 1; i++) {
int min = i;
for (int j = i + 1; j < a.length; j++) {
if (a[j] < a[min]) {
...