Question

Please help with this algorithms design problems. Thank you.

Use substitution method: 1. Show that the solution of T(n) = T(n-1) +n is O(n) Use master method to find tight asymptotic bou

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1)  Using substitution method
T(n) = T(n-1) + n

T(n)
= T(n-1) + n
= T(n-2) + n-1 + n
= T(n-3) + n-2 + n-1 + n
= T(1) + 2 + ... + n-2 + n-1 + n
= 1 + 2 + ... + n-2 + n-1 + n
= n(n+1)/2
so, T(n) = O(n^2)

2)
T(n) = 2T (n/4)+n This is in the form of T(n) = a1 + f(n) so, we can use masters theorem. compare nogoo with f(n) a = 2, b=4

3)

T(n) = 2T(n/4)+n2 This is in the form of T(n)=aTC) + f(n) so, we can use masters theorem. compare nlogta with f(n) a = 2, b=

Add a comment
Know the answer?
Add Answer to:
Please help with this algorithms design problems. Thank you. Use substitution method: 1. Show that the...
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