Question: data structures using java...plz ans fast 3 Show how the activation records are maintained in the stack for the following program for the function call

data structures using java...plz ans fast
3 Show how the activation records are maintained in the stack for the following program for the function call fun(a, 5), where the array a[5]={3, 5, 2, 7, 1). Show the value returned from each recursive function call and write the final output. int fun(int a[], int n) { int x; if(n == 1) return a[0]; else x = fun(a, n - 1); if(x > a[n - 1]) return x; else return a[n - 1]; } [5] [CO3]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
