Algorithm Analysis Problems #10) Please explain the solution thoroughly it\'s mo
ID: 3808773 • Letter: A
Question
Algorithm Analysis Problems #10)
Please explain the solution thoroughly it's more important than the answer itself. Here is my class work and a provided link to origonal word document. Thank You.
https://docs.google.com/document/d/1sgmQ24EZxDZL7WfqPh_hjz2MNu2wGGvl47rQrmFeagY/edit?usp=sharing
10. (10 pts) Give the output of cursive is called. F stands for Fibonacci following algorithm when F(4) numbers. function F(n> 0:integer) :integer if n 1 then else f(I) print n, print F endif return F f(4)Explanation / Answer
though input is f(4), the above logic will make us to calculate f(0) to f(4)
so for n<=1 ,f(n)=1 means f(0) =f(1)=1
for n=2, f(2) = f(0) +f(1) = 2
like wise for n=3, f(3) = f(2)+f(1)= 1+2=3
for n=4, f(4)= f(3)+f(2)= 2+3=5
so answer is 5.
Related 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.