retagged by
391 views

1 Answer

Best answer
2 votes
2 votes

Using recursion tree approach , we find cost at each level which is decided by f(n) and compare the cost of the current level with the previous level..

a) If the cost keeps on increasing with each level , then we have to evaluate the series as a whole which is normally a geometric progression.

b) If the cost at each level is constant , then time complexity is simply the cost at eah level * No of levels of recursion tree

c) If the cost at each level decreases , then it becomes the case of decreasing G.P. normally and hence the sum will be f(n) itself..

So in the given recurrence relation :  T(n) <=  T(n/5) + T(7n/10) + θ(n)

So cost in 1st level  =  f(n)  = cn for some constant c..Let us take c = 1 for simplicity.Hence cost becomes = n 

Cost in 2nd level    =  f(n)   = n/5 + 7n/10  =  9n/10

So we can see cost in 2nd level  < cost in 1st level.Hence it is the 3rd case according to the cases which are mentioned above..

Hence time complexity  =  n + 9n/10 + (9/10)2n  +  .............

                                   =  n(1 + (9/10) + (9/10)2 + .......)

                                   =  kn   =  O(n)

selected by

Related questions

3 votes
3 votes
1 answer
1
Prasanna asked Nov 26, 2015
1,604 views
Solve RecurrenceA) T(n) = T( √ n) + Θ(lg lg n)B) T(n) = T(n/2 + √ n) + √ 6046C) T(n) = T(n − 2) + lg nD) T(n) = √ n T( √ n) + 100n
1 votes
1 votes
1 answer
3
0 votes
0 votes
1 answer
4
lucasbbs asked Feb 28, 2022
6,816 views
How do I apply the master theorem in the above recurrence? Please give details about which case and on hiow to solve the asymptotic analysis...