1,920 views
2 votes
2 votes
int f (int n){

       if (n==0)

         return 0;

       if(n==1)

         return 1;

else

return f(n-1)+f(n-2);

}

Find the upper bound and lower bound to the number of function calls for input size 'n'?

2 Answers

1 votes
1 votes

O(2^n) function coll

 

Related questions

3 votes
3 votes
3 answers
3
Laxman Ghanchi asked May 19, 2023
1,111 views
#include<stdio.h void print(int n) { printf("Hello "); if(n++ == 0) return ; print(n); n++; } int main() { void print(); print(-4); }How many times printf execute?? And H...
0 votes
0 votes
1 answer
4
Laxman Ghanchi asked May 19, 2023
657 views
#include<stdio.h>void print(int n){ printf("Hello "); if(n++ == 0) return ; print(n); n++;}int main(){ void print(); print(-4);}