How do I prove that this recurrence relation is O(n^2)

83 Views Asked by At

I need to prove that $T(n)$ is $O(n^2)$: $$T(1)=a$$ $$T(n)=T(n-1)+\log(n-1)$$

1

There are 1 best solutions below

0
On BEST ANSWER

Just expand the equation: $$T(n) = \log(n-1) + \log(n-2) + \cdots + \log(1) = \log((n-1)!) < \log(n^n) = n\log(n)=O(n^2)$$