This is a problem from my homework. I am not quite sure about how to solve a problem like this.
If T(n) = nT(n - 1) and T(1) = 3, then
a) T(n) = O(n^n)
b) T(n) = Ω(n!)
c) T(n) = O(2^(nlogn))
d) none of the above
I dont need exact answer to this problem (since its homework), but I would like to know the way to tell the bound of a recursive function.
Just try working through it. Suppose
n = 3. How many iterations will there be? How about ifn = 4? How fast does the number of iterations grow when you increasen?Another way to look at it is: In the formula, how does a function “branch”? linear functions don’t branch, they only have simple 1:1 recursion. Exponential functions will branch several times. Logarithmic functions branch, but reduce the complexity of the data they operate on… etc.