Algorithms | Analysis of Algorithms | Question 10
The following statement is valid.
log(n!) = (n log n).
(A) True
(B) False
Answer: (A)
Explanation: Order of growth of and
is same for large values of
, i.e.,
. So time complexity of fun() is
.
The expression can be easily derived from following Stirling’s approximation (or Stirling’s formula).