Open In App

Algorithms | Analysis of Algorithms | Question 10

Like Article
Like
Save
Share
Report

The following statement is valid. log(n!) = \\theta (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

Last Updated : 13 Feb, 2013
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads