T(n) = 16T(n/4) + n!
I know it can be solved using Master theorem, but I don't know how to handle f(n) = n!
T(n) = 16T(n/4) + n!
I know it can be solved using Master theorem, but I don't know how to handle f(n) = n!
This is case three of Master Theorem.
Since T(n) = 16T(n/4) + n!
Here f(n) = n!.
a = 16 and b = 4, so logb a = log4 16 = 2.
Master Theorem states that the complexity T(n) = Θ(f(n)) if c > logb a where f(n) ∈ Ω(nc) . Since f(n) = n! > nc for some value of n > n0 the statement f(n) ∈ Ω (nc) is true. Thus the statement c > logb a =2 is also true. Hence by the third case of Master Thoerem the complexity T(n) = Θ(f(n)) = Θ(n!).