李振良Python DevOps运维开发实战集训营高级班
C语言实现:
void selectAlgorithm(int array[]){
int count = sizeof(array)/sizeof(int);
int index;
for (int i = 0; i < count - 1; i ++) {
index = i;
for (int j = i + 1; j < count; j ++) {
if (array[index] > array[j]) {
index = j;
}
}
if (index != i) {
int temp = array[i];
array[i] = array[index];
array[index] = temp;
}
}}