Question: Recursion problem : - Algorithm RecAVG ( A , i , j ) Input : Array A of size n , indices I and j

Recursion problem :-
Algorithm RecAVG(A,i,j)
Input : Array A of size n , indices I and j
If I = j
Return A[i]
End if
Mid -[( i + j )/2]
V1- RecAVG(A,I,Mid)
V2- RecAVG(A,mid+1,j)
Avg - V1+ V2
Return Avg /2
End Algorithm
1 state the base and the recursive cases
2 Draw the corresponding recursion tree when RecAVG(A,0,3) is invoked given that A =[10,6,2,4].
3- Determine the running time in terms of n
4 determine the space complexity in terms of n
 Recursion problem :- Algorithm RecAVG(A,i,j) Input : Array A of size

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 Databases Questions!