asked 94.3k views
0 votes
Use the Master theorem to determine the complexity class of the following recurrences:

i) T(n)=4 T(3n​)+5n2−2n+2, T(1)=2
(ii) T(n)=8 T(2n​)+7n3−5, T(1)=3
(iii) T(n)=5 T(2n​)+5n2+7, T(1)=4

1 Answer

4 votes

Explanation:

For the first recurrence relation, we have:

T(n) = 4T(3n) + 5n^2 - 2n + 2

Here, a = 4, b = 3, f(n) = 5n^2 - 2n + 2

Now, logb(a) = log3(4) ≈ 1.26

Since f(n) = Θ(n^2), we have c = 2

Therefore, by the Master Theorem, the complexity class of the recurrence relation is T(n) = Θ(n^2 log n).

For the second recurrence relation, we have:

T(n) = 8T(2n) + 7n^3 - 5

Here, a = 8, b = 2, f(n) = 7n^3 - 5

Now, logb(a) = log2(8) = 3

Since f(n) = Θ(n^3), we have c = 3

Therefore, by the Master Theorem, the complexity class of the recurrence relation is T(n) = Θ(n^3 log n).

For the third recurrence relation, we have:

T(n) = 5T(2n) + 5n^2 + 7

Here, a = 5, b = 2, f(n) = 5n^2 + 7

Now, logb(a) = log2(5) ≈ 2.32

Since f(n) = Θ(n^2), we have c = 2

Therefore, by the Master Theorem, the complexity class of the recurrence relation is T(n) = Θ(n^2 log n).

answered
User Gawil
by
8.2k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.