Friday, 9 August 2013

Merge sort explanation

Merge sort explanation

I am having hard time in understanding recursive calls in merge sort.I am
unable to trace the recursive calls.can anybody please explain in detail
about what is happening behind these calls.Here is the code...
int mergesort(int a[],int i,int j)
{
int mid;
if(i>=j)
return;
mid=(i+j)/2;
mergesort(a,i,mid);
mergesort(a,mid+1,j);
mergea(a,i,j);
}

No comments:

Post a Comment