Question 6Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Big-O estimates for the factorial function and the logarithm of the factorial function i.e. n! and log n! is given by

  1. AO(n!) and O(n log n)
  2. BO(nⁿ) and O(n log n)
  3. CO(n!) and O(log n!)
  4. DO(nⁿ) and O(log n!)
Show answerHide answer

Correct answer: (B) O(nⁿ) and O(n log n)

Explanation

N! < nⁿ for all n ≥ 1, so n! is O(nⁿ). Using Stirling's approximation, log(n!) ≈ n log n − n + O(log n), so log n! is O(n log n). Therefore, the correct answer is (b) O(nⁿ) and O(n log n).

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 6 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.