Open In App

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 \\log n! and n\\log n is the same for large values of , i.e.,  \\theta (\\log n!) = \\theta (n\\log n) . So time complexity of fun() is \\theta (n\\log n) . The expression \\theta (\\log n!) = \\theta (n\\log n) can be easily derived from following Stirling\’s approximation (or Stirling\’s formula). \\log n! = n\\log n – n +O(\\log(n))\\




Quiz of this Question
Please comment below if you find anything wrong in the above post
Article Tags :