Question: Computer Science I Exercise: Recursion: 9. What would be the value of fun(7) for the following function? int fun(int x) if(x==0) return 0; if(x%3 ==0)

Computer Science I

Exercise: Recursion:

Computer Science I Exercise: Recursion: 9. What would be the value of

9. What would be the value of fun(7) for the following function? int fun(int x) if(x==0) return 0; if(x%3 ==0) return fun(x/3); return fun(x-1) + X; 10. Draw the recursion tree to find out the value of f(5) int f(int n) int ans; int i; if(n

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!