Question
*algorithm analysis and design*


Solve the following recurrence relation T(n) = Tỉn/2) + 1 Using: 1-Recurrence Tree. 2-Master Therom.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

a)

10022 ... | ビーニー # ollos

Just like the picture above shows.

For a recurrence T(n)=aT(n/b)+f(n), first you should draw a a-ary tree. In this problema=1a=1, so we draw a 1-ary tree.

Then we calculate the depth of the tree, which is logbn

After that, we calculate the contribution of every level.

So, it is theta(log2(n))

b)

Your recurrence is

T(n) = T(n / 2) + O(1)

Since the Master Theorem works with recurrences of the form

T(n) = aT(n / b) + nc

In this case you have

  • a = 1
  • b = 2
  • c = 0

Since c = logba (since 0 = log2 1), you are in case two of the Master Theorem, which solves to Θ(nc log n) = Θ(n0 log n) = Θ(log n).

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
*algorithm analysis and design* Solve the following recurrence relation T(n) = Tỉn/2) + 1 Using: 1-Recurrence...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT