Enter one more number(Press Sort without entering any value to start the animation):

*-Press submit after entering every value of the array

ALGORITHM FOR INSERTION SORT


/*Initially x[0] may be thought of as a sorted file of one element */
/*After each repetition of the following loop, the elements x[0] */
/*through x[k] are in order.*/
for(k=1;k less_than n; k++)
{
/*insert x[k] into the sorted file*/
y=x[k];
/*move down 1 position all elements greater than y*/
for(i=k-1;i>=0 && y less_than x[i];i--)
{
x[i+1]=x[i];
}
/*insert y at proper position*/
x[i+1]=y;
}