I have some questions about selection sort.I\'m a little bit confused.
int [] arr = {5,4,3,2,1}; // This is my array
int min = 0;
for(int i = 0;i&l
Just pass array and size of array
private void selectionSort() {
for (int i = 0; i < arraySize; i++) {
for (int j = i; j < arraySize; j++) {
if (array[i] > array[j])
swapValues(i,j);
}
}
}
private void swapValues(int posOne, int posTwo) {
int tValue = array[posOne];
array[posOne] = array[posTwo];
array[posTwo] = tValue;
}