Recent questions tagged recursion

0 votes
2 answers
91
Find time complexity of below Program?A(n){if(n<=1) return;elsereturn $A(\sqrt{n})$ ;}
2 votes
1 answer
92
1 votes
2 answers
93
int zap(int n){if (n<=1) then zap =1;else zap = zap(n-3)+zap(n-1);}then the call zap(6) gives the values of zapGive the proper explanation
0 votes
0 answers
94
3 votes
3 answers
96
#include <stdio.h int main() { static int i=5; if( i) { main(); printf("%d ",i); } }
2 votes
2 answers
97
int f (int n){ if (n==0) return 0; if(n==1) return 1;elsereturn f(n-1)+f(n-2);}Find the upper bound and lower bound to the number of function ...
1 votes
1 answer
98
void ab() { auto int a; static int s= 5; a = ++s; printf("%d%d",a,s); if(a<= 7) ab(); printf("%d%d",a,s); } void main() { ab(); }According to me answer should be- 6677888...
2 votes
2 answers
100
To remove recursion from a program we have to use which of the following data structure?arraystackqueuelist
1 votes
0 answers
101
What will be the time complexity of the following algorithm ?A(n){if(n<=1) return 1;for(i=1;i<n;i++){ for(j=0;j<3;j++){ A(n-1) } }}
1 votes
0 answers
102
7 votes
3 answers
103
Why is recursive equation of following code $T(n)=T(n/2)+O(1)$, not $T(n)=8*T(n/2)+O(1)$? int x=0; int A(n) { if(n==1) return 1; else { X+=8A(n/2)+n^3; } return X; }
0 votes
0 answers
105
What is the max height of recursion tree of recurrence $c(100,50)$?here, the recursive function is defined as$c(n,k) = c(n-1,k-1) + c(n,k-1)$terminating condition$c(n,n) ...
0 votes
1 answer
107
What data structure would you most likely see in a non-recursive implementation of a recursive algorithm?Linked ListStack QueueTreeplease explain also
0 votes
1 answer
111
did recursion is bottom up approach to problem solving?
5 votes
0 answers
114
T(n) $\leq$ T($\frac{n}{5}$) + T($\frac{7n}{10}$) + 15nT(n) $\leq$ 5 when n $<$ 6
4 votes
0 answers
115
9 votes
1 answer
116
2 votes
0 answers
119
State which one is true1) Every left recursive grammar can be converted to right recursive grammar2) Every right recursive grammar can be converted to left recursive gram...
3 votes
1 answer
120