//简单选择排序,
//O(n^2)
/*
对一个序列A中的元素A[0]~A[n-1],
循环for(i=0;i<n;i++)n次遍历
每次从待排序的A[i]~A[n-1],中,挑出最小的元素
与A[i]交换
*/
void selectSort()
{
for(int i=0;i<n;i++){
int zuixiao=i;
for(int j=i;j<n;j++){
if(A[j]<A[zuixiao])
zuixiao=j;
}
int temp=A[zuixiao];
A[zuixiao]=A[i];
A[i]=temp;
}
}