Question: (a) Explain why computing the factorial of (n) by multiplying all values from 1 to (n) together is an exponential time algorithm. (b) Explain why
(a) Explain why computing the factorial of \(n\) by multiplying all values from 1 to \(n\) together is an exponential time algorithm.
(b) Explain why computing an approximation to the factorial of \(n\) by making use of Stirling's formula (see Section 2.2) is a polynomial time algorithm.
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Time Complexity Analysis a Computing Factorial using Multiplication When you calculate the factorial of n denoted by n 1 cdot 2 cdot 3 cdots n you per... View full answer
Get step-by-step solutions from verified subject matter experts
