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