Home › Previous year questions › GATE 2021 CS (CS1) › Question 14GATE 2021 CS (CS1) – Question 14 Compiler Design · Runtime Environments · 1 mark · Multiple choice
Consider the following statements. $S_1$: The sequence of procedure calls corresponds to a preorder traversal of the activation tree. $S_2$: The sequence of procedure returns corresponds to a postorder traversal of the activation tree. Which one of the following options is correct?
$S_1$ is true and $S_2$ is false $S_1$ is false and $S_2$ is true $S_1$ is true and $S_2$ is true $S_1$ is false and $S_2$ is false Practise this question in The GATE Grind →
Show answer and explanation Correct answer: (C) $S_1$ is true and $S_2$ is true
Explanation A procedure is called before its children (preorder) and returns after all its children have returned (postorder). Both statements are true.
More Runtime Environments questions GATE 2020 CS Q19 – Consider the following statements. I. Symbol table is accessed only during lexical… GATE 2018 CS Q18 – Which one of the following statements is FALSE? GATE 2014 CS (CS2) Q28 – Which is NOT performed during compilation? GATE 2014 CS (CS3) Q28 – Which statements are correct? 1. Static allocation of all data areas by a compiler makes… GATE 2012 CS Q46 – In a lexically scoped block-structured language, main contains sibling procedures A1 and… GATE 2010 CS Q24 – Which languages necessarily need heap allocation in their runtime environment? All Runtime Environments questions →