a) Write three alternative implementations of the factorial function (n!) in pse
ID: 1942267 • Letter: A
Question
a) Write three alternative implementations of the factorial function (n!) in pseudocode; at least one must be recursiveb) For one of your recursive implementations of the factorial function write out the stack of calls as the code executes for calculating 3!
c) Calculate the big-O running time of one of your implementations of the factorial function (assume multiplication takes 1 step and give your answer in terms of the input value n; please indicate which implementation you have chosen to analyze)
d) Which one of your solutions is the
Explanation / Answer
a) Recursive Implementation,Iterative implementation,Recurrence, b) using System; //calculating factorial with recursion namespace ConsoleApplication2 { class Program { long fun(long a) { if (aRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.