Open In App

GATE | GATE CS 2021 | Set 1 | Question 14

Consider the following statements.

Which one of the following options is correct?
(A) S1 is true and S2 is false
(B) S1 is false and S2 is true
(C) S1 is true and S2 is true
(D) S1 is false and S2 is false

Answer: (C)
Explanation: The use of a run-time stack is enabled by several useful relationships between the activation tree and the behavior of the program:

On each procedure call, an activation record for that procedure is pushed on the stack. When the call returns, that activation record is popped from the stack.
The order in which these activations were called is the order in which they appear along the path to N, starting at the root, and they will return in the reverse of that order.
Quiz of this Question

Article Tags :