• retagged by
6,699 views
2 2 votes

Question:

$T(1)=1$

$T(n) = 2 T(n - 1) + n$

evaluates to?

Can anyone solve it by substitution method?


Given answer 

$T(n) = 2^{n+1} - (n+2)$

How? 

3 Answers

0 0 votes

TRICK

put any value in question and answer....if they match then correct solution

 

otherwise solve with substitution method... then you will get the answer

0 0 votes
Solve the by hit and trial method

Put the n= 2

We find  T(2)= 2T(2-1) +2

                        = 2*1+2=4

And the check options is equal to 4

So options (a) is correct
Position:
Show:

Related questions

0 0 votes
3 3 answers
3.2k
3.2k views
Priyanka Agarwal asked Jul 11, 2018
3,191 views
Given array of n-distinct elements. What is the worst case running time to find $\mathrm{i}^{\text {th }}$ smallest element ( $1 \leq i \leq \mathrm{n}$ ) from those n el...
0 0 votes
1 1 answer
632
632 views
Manoj Kumar Pandey asked Jun 20, 2018
632 views
We've been given an unordered list having n distinct elements,the no. Of comparison to find an element that is neither the 2nd minimum nor the 2nd maximum is?
0 0 votes
1 1 answer
951
951 views
Shankar Jha asked Jun 15, 2018
951 views
Assume that merge sort algorithm in the worst case takes 30 seconds for an input of size 64 which of The following most closely approximates the maximum input size of a p...
0 0 votes
1 answers 1 answer
684
684 views
srishtipandey420 asked Jun 20, 2024
684 views
How can we solve this recurrance relation using master's theorem? T(n)=2 * T (n/2) + nlogn