in Algorithms
377 views
0 votes
0 votes
Compute: T(n) = 2^nT(n/2) +n^n

1)theta(n^n)

2)theta(nlogn)

3)theta(n^nlogn)

4)none of these.
in Algorithms
377 views

1 comment

option (A)?
0
0

1 Answer

0 votes
0 votes

According to master theorem - 

T(n) = aT(n/b) + f(n) where a >= 1 and b > 1

There are following three cases:
1. If f(n) = Θ(nc) where c < Logba then T(n) = Θ(nLogba)

2. If f(n) = Θ(nc) where c = Logba then T(n) = Θ(ncLog n)

3.If f(n) = Θ(nc) where c > Logba then T(n) = Θ(f(n))

  1.  a = 2^n
  2. b = 2
  3. c = n
  4. c = Logba
  5. T(n) = Θ(ncLog n)

so T(n) = Θ(n^n Log n)

1 comment

sorry, but we cannot apply master theorem here as "a" is not constant. 

check for ref : https://en.wikipedia.org/wiki/Master_theorem_(analysis_of_algorithms)#Inadmissible_equations

1
1
Answer:

Related questions