GATE CSE
First time here? Checkout the FAQ!
x
0 votes
148 views
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
asked in Algorithms by Active (1.2k points)  
edited by | 148 views
I dont think master theorem can be applied for this..for the first one it just a harmonic series it will be O(logn).Try subsitution method.

1 Answer

0 votes
t(n)=t(n/2)+t(n/4)+t(n/8) +n;

the above equation can be reduced to

T(n)<3T(n/2)+n

here a=3;b=2

so

a>b

hence by masters theorem T(n)=θ(n^log3 to base 2)
answered by (369 points)  


Top Users Mar 2017
  1. rude

    5246 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1440 Points

  8. Bikram

    1432 Points

  9. Akriti sood

    1420 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,553 questions
26,902 answers
61,258 comments
23,269 users