void SelectSort(int* Data,int Count)
{
int iTemp;
int iPos;
for(int i=0;i<Count-1;i++)
{
iTemp = Data[i];
iPos = i;
for(int j=i+1;j<Count;j++)
{
if(Data[j]<iTemp)
{
iTemp = Data[j];
iPos = j;
}
}
Data[iPos] = Data[i];
Data[i] = iTemp;
}
}
No comments:
Post a Comment