• edited by
1,994 views
0 0 votes
1) T(n)=T(n-1)+1/n.
2) T(n)=T(n-1) +1/log(n)

3)T(n)=3T((n/3) - 2)+n/2.
4)T(n)=T(n/2)+T(n/4)+T(n/8)+n.
Use Masters theorem

3 Answers

1 1 vote

Question 1: Master Theorem not possible since b=1, which is not greater than 1.
Question 2: Master Theorem not possible since b=1, which is not greater than 1.
Question 3:
T(n)=3T( (n/3) - 2 ) +n/2 = 3T((3n-6)/3)+n/2 = 3T(3(n-2)/3)+n/2 = 3T((n-2))+n/2
Now, Master Theorem not possible since b=1, which is not greater than 1.

Question 4: T(n)=T(n/2)+T(n/4)+T(n/8)+n

Roughly, T(n) can be written as T(n)<T(n/2)+T(n/2)+T(n/2)+n, which can be further reduced to
T(n)<3T(n/2) + n
Now, a = 3, b=2, k=1, p=0
Clearly, a > bk i.e. 3>21.

So, Case 1 satisfies. Therefore, T(n)=Theta(nlg3) = Theta(n1.584962...) = Theta(n)

I hope it helps. :)

Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
2.4k
2.4k views
lolster asked Jun 12, 2019
2,428 views
How to check if a given recurrence relation is in a format that is valid to apply Master’s Theorem? Also, how to distinguish between Master’s Theorem and extended Master’...
2 2 votes
6 6 answers
26.8k
26.8k views
mohitrai0_0 asked Sep 28, 2018
26,819 views
I was wondering whether the recurrence T(n) = T(n/2) + 2n could be solved by using master theorem, and what would be the way. I tried solving the recurrence but can't. Th...
0 0 votes
0 0 answers
1.5k
1.5k views
pradeepchaudhary asked Aug 20, 2018
1,544 views
T (n) = T (n/2) + 2nUsing Master's Method What is the Complexity Of This Recurrence Relation?Or Using AnyOther Method?
0 0 votes
2 2 answers
4.2k
4.2k views
manvi_agarwal asked Aug 10, 2018
4,186 views
Solution using back substitution methodT(n) = 2T(n/2) + nlogn ?detailed solution please.ans is nlognlogn or n(logn)^2