Discussion
Big-O estimates for the factorial function and the logarithm of the factorial function i.e. \(n!\) and \(\log n!\) is given by
Answer: B
The estimates are \(O(n^{n})\) for \(n!\) and \(O(n \log n)\) for \(\log n!\). Since \(n! = 1 \cdot 2 \cdots n\) is at most \(n \cdot n \cdots n = n^{n}\), \(n!\) is \(O(n^{n})\), and taking logarithms gives \(\log n! \le n \log n\), so \(\log n!\) is \(O(n \log n)\). The options that give \(O(n!)\) for \(n!\) are trivially true but not the estimate of the key, and \(O(\log n!)\) merely repeats the function.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development