Question: 24. Consider the following classical recursive algorithm for computing the factorial n! of a non-negative integer n: FACTORIAL(n): if n=0 else return 1 return

24. Consider the following classical recursive algorithm for computing the factorial n!  

24. Consider the following classical recursive algorithm for computing the factorial n! of a non-negative integer n: FACTORIAL(n): if n=0 else return 1 return n FACTORIAL (n - 1) (a) How many multiplications does this algorithm perform? (b) How many bits are required to write n! in binary? Express your answer in the form (f(n)), for some familiar function f(n). [Hint: (n/2)/2 < n!

Step by Step Solution

3.56 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a The algorithm performs n multiplications b To write n in binary we ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!