Recent questions tagged recurrence-relation

1 votes
1 answer
632
How to build Recurrence relation for Time complexity double foo(int n) { int i; double sum; if(n == 0) { return 1.0; } else { sum = 0.0; for(i = 0; i < n; i++) { sum += f...
3 votes
1 answer
633
Solve the equation: $$a_n = 5a_{n/3} + 7, \;\; a_1 = 5$$Note: $a_0$ is not given.
1 votes
1 answer
634
Recurrence relation T(1)=1 T(n)=2T(n-1)+n n>=2 evaluates to ..Pls explain with detailed steps..
1 votes
1 answer
635
1 votes
1 answer
636
T(n) = T(n-1)+ 1/n if n>1 =1 otherwiseThe order of the algorithm is
1 votes
2 answers
637
T(n) = T(n-1) + T(n-2) + c i want solve it using substitution method..T(n) <= 2 T(n-1) + c is this a correct way ??plz explain ...if its wrong then what is correct w...
2 votes
0 answers
639
2 votes
1 answer
642
7 votes
3 answers
643
T.C of T(n)=2T(n-1)+n,n 1 ,T(1)=1 ?
3 votes
3 answers
646
$$T(n)\quad=\quad T(n-1)+T \left (\frac{n}{2} \right )+n$$ $$n \geq 1, \quad T(1)=1$$
1 votes
3 answers
647
Consider the given recurrence relation , find the time complexity ?T(n)=2T(n-1)+T(n-2)+C, T(0)=T(1)=1 
0 votes
3 answers
648
Find time complexity int R(int n) { if(n<=1) return 1; else { int sum=0; for(int i=1;i<=n;i=i*2) for(j=1;j<=i;j=j*2){ sum=sum+i; sum=sum*R(n/2); } } return sum; }
2 votes
3 answers
652
Can masters theorem solve the recurrence 4T(n/2) + n2.logn ? it is said that it falls between the case 2 & 3 and no solution possible with this method .can anyone explai...
2 votes
2 answers
653
int fun(int x, int y) { if (y == 0) return 0; return (x + fun(x, y-1)); } int fun2(int a, int b) { if (b == 0) return 1; return fun(a, fun2(a, b-1)); }
1 votes
1 answer
654
T(n) = T(n - 1) + 1/na) O(1)b) O(n)c) O(log n)d) O(log log n)
0 votes
2 answers
655
every time while finding recurence solution (in CLRS book , page 88) a statement "Floors and ceilings usually do not matter when solving recurrences" but my doubt is whe...
14 votes
5 answers
656
0 votes
1 answer
657
T(n+1)=T(n)+ceil[√(n+1)] , n>1 =1,n=1
0 votes
1 answer
658
T(n)=√nT(√n)+√n , n>2 =2 ,n=2
1 votes
1 answer
659
At the end of it's 5th Successful season,The siruseri Permier league is planning to give an award to most improved bowler over 5 years . For this an important Index will ...