Question: write the following recursive function foo which returns the second maximum of an integer array (with at least two elements and all distinct integers) hint:
write the following recursive function foo which returns the second maximum of an integer array (with at least two elements and all distinct integers)
hint: Say we have A[100] in main; to set n to second max, foo will bi called as follows: if(A[0] > A[1]) n = foo(A+2, 98, A[0], A[1]); else n= foo(A+2,98,A[1],A[0] );
int foo(
){
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
