Saturday, 28 February 2015

insertion sort


for(int i=1;i<n;i++)
{
   temp=a[i];
  j=i-1;
while(temp<a[j] && j>=0)
{
a[j+1]=a[j];
a[j]=temp;
--j;
}

No comments:

Post a Comment