Show the display at the moment the first call to fib01 is


Suppose that we implement the functions of Figure using a display. Show the display at the moment the first call to fib0(1) is about to return. Also, indicate the saved display entry in each of the activation records on the stack at that time.

Given is : Nested functions computing Fibonacci numbers

fun main 0 {

let

fun fib0(n)=

let

fun fib1(n) =

let

fun fib2(n) = fib1(n-1) + fib1(n-2)

in

if n >= 4 then fib2(n)

else fib0(n-1) + fib0(n-2)

end

in

 

if n >= 2 then fib1(n)

 

else 1

 

end

 

in

 

fib0(4)

 

end;

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Show the display at the moment the first call to fib01 is
Reference No:- TGS01718691

Expected delivery within 24 Hours