227k views
3 votes
Show the stack with all activation record instances, including static and

dynamic chains, when execution reaches position 1 in the following skeletal
program. Assume Bigsub is at level 1.
procedure Bigsub is
MySum : Float;
procedure A is
X : Integer;
procedure B(Sum : Float) is
Y, Z : Float;
begin -- of B
. . .
C(Z)
. . .
end; -- of B
begin -- of A
. . .
B(X);
. . .
end; -- of A
procedure C(Plums : Float) is
begin -- of C
. . . <-----------1
end; -- of C
L : Float;
begin -- of Bigsub
. . .
A;
. . .
end; -- of Bigsub

User Mparaz
by
5.3k points

1 Answer

5 votes

Answer:

See explaination

Step-by-step explanation:

A stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle.

A stack is a limited access data structure - elements can be added and removed from the stack only at the top. push adds an item to the top of the stack, pop removes the item from the top.

Please kindly check attachment for the step by step solution of the given problem.

Show the stack with all activation record instances, including static and dynamic-example-1
Show the stack with all activation record instances, including static and dynamic-example-2
User Rashwan L
by
5.5k points