After this code is executed what values are stored in the array a?Code:char a[] = {21,12,5,7,1,9}; int size = 6; int i,j,temp; for(i=1;i<size;i++) { temp=a[i]; for(j=i; (j>0) && (a[j-1]>temp); j--) { a[j]=a[j-1]; } a[j]=temp; }
The answer is:
{1,5,7,9,12,21}
However, I do not understand the steps undertaken to get to this solution.
IF somebody can show how they reached the FIRST array I could work from there.