Description
There are three questions in total, and there are many sub-questions.
Please type the answer and pay attention to the format. Thank you!
Unformatted Attachment Preview
Explanation & Answer
Please view explanation and answer below.
1
Algorithm Analysis
Student’s Name
Institutional Affiliation
Unit Code: Name
Professor’s Name
Date
2
Question 1
a) T(n)=8T(n/2) + cn, T (1) =C
Master theorem applies.
A=8, b=2 d=1
Since a>b thus we are in case 3.
T(n)= O(nlogba) from case 3
=O(nlog28) since a=8 and b=2.
=log28 =3
=O(n3)
=T(n)=ϴ(n3).
b) T(n)= 4T(n-2)+1,T(1)=1
compare the recurrence relance with
T(n)=aT(n/b)+0(nk logpn)
We have a=4 =0 k=0 p=0
T(n)=4+1
T(n)=5
Since p=0 , we have
T(n)=0(nklogpn)
T(n)=0(n0 log0n)
T(n)=0(n0)
T(n)=0
3
c) 3T(n/3) + cn1/2, T (1) =c
Master theorem applies.
A=3 b=3 d=1
Since a=b thus we are in case 2.
T(n)=O (nd logn) from case 2.
=O(n1logn) since d=1
=O(nlogn)
=T(n)=O(nlo...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Their Eyes Were Watching God
by Zora Neale Hurston
Moby Dick
by Herman Melville
Of Mice and Men
by John Steinbeck
The Book Thief
by Markus Zusak
The King Must Die
by Mary Renault
The Mayor of Casterbridge
by Thomas Hardy
The Nightingale
by Kristin Hannah
Fast Food Nation
by Eric Schlosser
Treasure Island
by Robert Louis