int sillyone(int n) { if (n <= 1) return n; else return sillyone(n-1) + sillyone
ID: 3616471 • Letter: I
Question
int sillyone(int n){
if (n <= 1)
return n;
else
return sillyone(n-1) + sillyone(n-1);
}
int sillytwo(int n)
{
if (n <= 1)
return n;
else
return 2 * sillytwo(n-1);
}
Output of sillyone(5) is
Output of sillytwo(5) is .
# of sillyone() invocations done as part of sillyone(5) executionis .
# of sillytwo() invocations done as part of sillytwo(5) executionis .
I believe the output of sillyone(5) is 8 and the output ofsillytwo(5) is also 8. Just want to verify.
I do need the answers to the 2nd part of the test - theinvocations.