Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have put ??? where I need the answers. Thanks for ANY help. int new_largest(co

ID: 3616472 • Letter: I

Question

I have put ??? where I need the answers.

Thanks for ANY help.

int new_largest(const int list[], int lowerIndex, intupperIndex)
{
int max1, max2, half_items;

if (lowerIndex == upperIndex)
return list[lowerIndex];

half_items = (upperIndex - lowerIndex + 1) / 2;

max1 = new_largest(list, lowerIndex, lowerIndex +half_items-1);
max2 = new_largest(list, lowerIndex + half_items,upperIndex);

if (max1 > max2)
return max1;
else
returnmax2;               
}

Function largest() is invoked ??? times when largest(list, 0, 7) isexecuted,
whereas function new_largest() is invoked ??? times whennew_largest(list, 0, 7) is executed.

Max recursion depth reached while computing largest(list, 0, 63) is???,
whereas max recursion depth reached while computingnew_largest(list, 0, 63) is ???.

Explanation / Answer

now it's complete please rate - thanks #include #include using namespace std; int new_largest(const int list[], int lowerIndex, intupperIndex,int &count) { int max1, max2, half_items; count++; if (lowerIndex == upperIndex) return list[lowerIndex]; half_items = (upperIndex - lowerIndex + 1) / 2; max1 = new_largest(list, lowerIndex, lowerIndex +half_items-1,count); max2 = new_largest(list, lowerIndex + half_items,upperIndex,count); if (max1 > max2) return max1; else returnmax2;                } int largest(const int list[], int lowerIndex, int upperIndex,int&count) { int max; count++; if(lowerIndex == upperIndex) // the size of the sublist is 1     return list[lowerIndex]; else {    max = largest(list, lowerIndex + 1,upperIndex,count); if(list[lowerIndex] >= max)    return list[lowerIndex]; else    return max; } } int main() {int count,i; int list[100]; srand(time(0)); for(i=0;i