Something feels off about my code but im not sure whatq
public static void sort(int[] array) {
int index = 0;
while (index < array.length) {
int smallest = Integer.MAX_VALUE;
int smallestIndex = -1;
for (int i = index; i < array.length; i++) {
if (smallest > array[i]) {
smallest = array[i];
smallestIndex = i;
}
}
int temp = array[smallestIndex];
array[smallestIndex] = array[index];
array[index] = temp;
index++;
}
}