I am having trouble undestanding this code, can someone please help. I dont understand what the for loops do also.
void Merge( long array[], long left, long middle, long right )
{
long i, j;
long temp[MAX_ARRAY_SIZE];
for( i = middle + 1; i > left; i-- )
temp[i - 1] = array[i - 1];
for( j = middle; j < right; j++ )
temp[right + middle - j] = array[j + 1];
for( long k = left; k <= right; k++ )
if( temp[j] < temp[i] )
array[k] = temp[j--];
else
array[k] = temp[i++];
}