edited by
1,369 views

2 Answers

4 votes
4 votes

....

–1 votes
–1 votes

I think you want to ask time complexity of recurrence relation.

It is easy to solve by recurrence tree.

1st level:       O(n)

2nd level =  O( 7n/10 + n/5) = O(9n/10)

3rd level  =  O( 7n/50 + 49/100 + 7n/50 + n/25)   =  O (81n/100)  

...

................. and so on.

T (n)   =  O ( n + 9n/10 + 81n/100 + ..................)  ( infinite G.P sum)

          = O(10n) = O(n)

Related questions

1 votes
1 votes
2 answers
4