/* * To implement the Insertion Sort algorithm for sorting an array of 8 integers * @author-Karan Narain(karan@iitk.ac.in) * */ #include void insertionSort(int A[]) { int i,j,k; for(j=1;j<8;j++) { printf("\n Before Pass %d: ",j); for(i=0;i<8;i++) { printf(" %d ",A[i]); } printf("\n"); k=A[j]; //Find appropriate position for insertion of k=A[j] in the sorted sublist for(i=j-1; i>=0 && k