CodeChef/Beginner/TSORT.cpp
void mergeSort(unsigned long long arr[], unsigned long long l, unsigned long long r)
{
    if (l < r)
    {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        unsigned long long m = l+(r-l)/2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m+1, r);

        merge(arr, l, m, r);
    }
}
/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
l is for left index and r is right index of the
sub-array of arr to be sorted
l is for left index and r is right index of the sub - array of arr to be sorted
void mergeSort(unsigned long long arr[], unsigned long long l, unsigned long long r)
{
    if (l < r)
    {
        unsigned long long m = l+(r-l)/2;
        mergeSort(arr, l, m);
        mergeSort(arr, m+1, r);
        merge(arr, l, m, r);
    }
}
void mergeSort ( unsigned long long arr [ ] , unsigned long long l , unsigned long long r ) { if ( l < r ) { unsigned long long m = l + ( r - l ) / 2 ; mergeSort ( arr , l , m ) ; mergeSort ( arr , m + 1 , r ) ; merge ( arr , l , m , r ) ; } }
l is for left index and r is right index of the
sub-array of arr to be sorted
l is for left index and r is right index of the sub - array of arr to be sorted
// Same as (l+r)/2, but avoids overflow for // large l and h // Sort first and second halves