643 views
2 votes
2 votes

how to solve this? 

1 Answer

0 votes
0 votes

@samarpita

Let’s expand the recurrence:

Your code lacks the +c part of the recursion,

so I assume that the code is wrong and the recursion T(n) = 2^nT(n-1) + c is correct...

Let f(n)=T(n)/c!,

then f(n)

= T(n)/c!

= n(T(n-1)+1)/c!

= T(n-1)/(n-1)! + 1/(n-1)!

= f(n-1) + 1/(n-1)!

= sum(1,n-1, 1/k!)

~ e

Thus T(n) ~ e*c!…

 

 

1. https://gateoverflow.in/247755/Can-we-solve-the-recurrence-n-by-masters-theorem-if-possible 

 

2. https://web.stanford.edu/class/archive/cs/cs161/cs161.1168/lecture3.pdf

 

3. https://gateoverflow.in/16246/T-n-t-n-2-n-recurrence-equation-solution-t-1-1 

 

4. https://gateoverflow.in/46274/T-n-t-n-1-t-n-2-n

 

 

edited by

Related questions

0 votes
0 votes
0 answers
1
OneZero asked Nov 28, 2018
374 views
Prove dijkstra’s algorithm using Heap is O((n+|E|)logn) where n is no.of vertices and |E| is number of edges?Book : Fundamentals of Computer Algorithms By sahni pa...
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
Dknights asked Dec 27, 2023
160 views
In the following question common lcs numbers are 4 so first 3 option should be correct or only first...there is no only written in 2,3 like only 2 or 3 so we can mark 2,3...
2 votes
2 votes
0 answers
4
meghna asked Oct 3, 2018
515 views
Consider the multistage graph with 6 stages then what is the minimum cost from Source node (A) to Destination node (N) using Greedy Method ______