0

I just can't solve this problem, I'm new to reccurences. I have this recurrence

$T(n)=n*T(n-1)$
$T(1)=1$

The second term will be:

$T(n-1)=(n-1)*T(n-2)$

And so on.

It's complexity is O(n!) but i don't know how to solve it.

I hope you can help me with an idea!

François
  • 659
  • 5
  • 16
Ruben P
  • 31
  • 4
  • 1
    First, be clear about what you mean by "complexity of a recurrence relation". Do you simply want to solve the recurrence, or determine the computational cost of evaluating it (naively following the definition)? – Raphael Jun 25 '15 at 23:52

1 Answers1

0

Hint: Prove by induction on $n$ that $T(n) = n!$.

Note that a recurrence relation doesn't have a complexity. Rather, it defines a function. In many cases, this function is the running time of some algorithm, and then the time complexity of the algorithm is the solution to the recurrence.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • If we're being careful about terminology, algorithms don't have a complexity but running time. Complexity is a property of problems. – David Richerby Jun 25 '15 at 21:24