Algorithm Analysis Report

User Generated

Enlmmmk

Computer Science

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

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

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...


Anonymous
Just what I needed…Fantastic!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags