Question: dentify what algorithm or concept the following code relates to . void Func ( int array [ ] , int tempArray [ ] , int

dentify what algorithm or concept the following code relates to.
void Func(int array[], int tempArray[], int left, int right)
{
int i, j, k, middle;
if(right > left)
{
middle =(right + left)/2;
Func(array, tempArray, left, middle);
Func(array, tempArray, middle +1, right);
for (i = middle +1; i > left; --i)
tempArray[i-1]= array[i-1];
for(j = middle; j < right; ++j)
tempArray[right + middle - j]= array[j+1];
if (tempArray[i]< tempArray[j])
array[k]= tempArray[i++];
else
array[k]= tempArray[j--];
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!