Question: 3 Show how the activation records are maintained in the stack for the following program for the function call fun, 5), where the array a[5)=13,

3 Show how the activation records are maintained in the stack for the following program for the function call fun, 5), where the array a[5)=13, 5, 2, 7, 11 Show the value returned from each recursive function call and write the final output. int fun(int al .int n) int x; if(n=1) retum a[0]: else x = fun an 1): if(x > an. 11) retum : else retum an - 11: 1 151 [003]
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
