int rFibNum(int a, int b, int n) { if(n == 1) return a; else if( n ==
Fantastic news! We've Found the answer you've been seeking!
Question:
{
if(n == 1)
return a;
else if( n == 2)
return b;
else
return rFibNum(a,b, n-1) + rFibNum(a, b, n-2);
}
In the code above;
a) how many base cases are there?
b) what is the limiting condion?
Related Book For
Computer Organization And Design The Hardware Software Interface
ISBN: 9780123747501
4th Revised Edition
Authors: David A. Patterson, John L. Hennessy
Posted Date: