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:

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
Get step-by-step solutions from verified subject matter experts
