I guess O(log(n!))
is asymptotically slower than O(n)
.
Am I right ?
Asked
Active
Viewed 141 times
-3

Charan Shetty
- 135
- 1
- 7
-
1Look up Stirling's formula, it answers this question. – Nate Eldredge Sep 16 '21 at 16:56
1 Answers
1
Unfortunately, your guess is completely wrong! try to expand log(n!)
as the following:
log(n!) = log(n * (n-1) * ... * 1) > log(n * (n-1) * ... * n/2) >
log((n/2)^n) = n log(n/2) \in Theta(n log(n))`
Therefore, n \in O(log(n!))

OmG
- 18,337
- 10
- 57
- 90
-
@CharanShetty Definitely, the growth of `n log n` is faster than `n`. Is it clear for you? – OmG Sep 16 '21 at 17:10
-