Wednesday, January 15, 2025
Google search engine
HomeData Modelling & AIAlgorithms | Analysis of Algorithms | Question 10

Algorithms | Analysis of Algorithms | Question 10

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments