Question: Recursion problem : - Algorithm RecAVG ( A , i , j ) Input : Array A of size n , indices I and j
Recursion problem :
Algorithm RecAVGAij
Input : Array A of size n indices I and j
If I j
Return Ai
End if
Mid i j
V RecAVGAI,Mid
V RecAVGAmidj
Avg V V
Return Avg
End Algorithm
state the base and the recursive cases
Draw the corresponding recursion tree when RecAVGA is invoked given that A
Determine the running time in terms of n
determine the space complexity in terms of n
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
