in Unknown Category
391 views
1 vote
1 vote
What is the running time of following recurrence relation?

T(n) = T(n/2) + T(n/4) + T(n/8) + n
in Unknown Category
391 views

2 Answers

2 votes
2 votes

using recurrence tree method ans is theta(n). 


 

0 votes
0 votes
Can be written as T(n) = T(n/2)  + theta(n).
T(n) = n + n/2 +n/4 + n/8.........
T(n) = n(1 + 1/2 +1/4......).
T(n) = n*1.
T(n) = theta(n)

2 Comments

Why have you ignored the T(n/4) and T(n/8)
0
0
Because the computation time taken by them is less in comparison to T(n/2), so we can neglect them to get the got idea.
0
0