Kod: Zaznacz cały
void InsertSort(int *X, int n)
{
int temp, i,j;
for(i=1;i<n;i++){
temp = *(X+i);
j=i-1;
while((temp < *(X+j)) && (j>0)){
*(X+j+1)=*(X+j);
j=j-1;
}
*(X+j) = temp;
}
}