in Programming in C retagged by
408 views
6 votes
6 votes

Consider the following pair of mutually recursive functions. What does $g(g(2))$ evaluate to?

int f(int n){
    if (n==0) return 0;
    return f(n-1)+g(n-1);
}
int g(int n){
    if (n==0) return 1;
    return g(n-1) + f(n);
}
in Programming in C retagged by
408 views

1 comment

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$
All India Mock Test 2 - Solutions Part 2

0
0

1 Answer

5 votes
5 votes

$\color{Green}\text{Ans: 89}$

2 Comments

A base condition exploration approach could save some time :)) 

2
2
+1
In exam quick approach is useful and also necessary. ;)
But for clear understanding doing analysis also necessary :)
1
1