Question: Consider the following Python program, where we have nested subprogram declarations. foo 1 1 and foo 1 2 are declared in foo 1 . Similarly,

Consider the following Python program, where we have nested subprogram declarations. foo 11 and foo 12 are declared in foo 1. Similarly, foo 21 and foo 22 are declared in foo 2. The main part of the program has a call to foo 2.
def foo_1():
def foo_1_1():
x=1
def foo_1_2():
foo_1_1()
# body of foo_1 starts here
foo_1_2()
def foo_2():
def foo_2_1():
foo_1()
def foo_2_2():
foo_2_1()
# body of foo_1 starts here
foo_2_2()
# main starts here
foo_2()
ARI of ... ARI of ... ARI of ... ARI of ... ARI of ... ARI of ... ARI of ... ARI of ... ARI of MAIN
Powered by TCPDF (www.tcpdf.org)
Consider the moment the program reaches to the statement x =1. Give the activation record instances on the run time stack at that moment. Also give the where the dynamic link and static links of these activation record instances point.
- Use solid lines for dynamic links and dashed lines for static links.
- You dont need to show the other fields of the activation records.
- The number of ARIs given above on the right is not necessarily equal to the number of ARIs that will actually appear on the run time stack when the program reaches to the statement x =1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!