Initialize
Enter Array Size
Step Execution
int main(){
int i, j, size, key ;
int A[size];
for( i = 1 ; i < size ; i++ )
{
key = A[i];
j = i - 1;
while ( j >= 0 && A[j] > key )
{
A[j+1] = A[j];
j--;
}
A[j+1] = key;
}
return 0 ;
}
Code Output
Sorted
Unsorted
Key Position
0
Key Value