Question

    Consider the following statements.

    S1:  The sequence of procedure calls corresponds to a postorder traversal of the activation tree.

    S2:  The sequence of procedure returns corresponds to a preorder traversal of the activation tree.

    Which one of the following options is correct?

    A S1 and S2 both are true Correct Answer Incorrect Answer
    B S1 and S2 both are false Correct Answer Incorrect Answer
    C S1 is true and S2 is false Correct Answer Incorrect Answer
    D S1 is false and S2 is true Correct Answer Incorrect Answer
    E None of these Correct Answer Incorrect Answer

    Solution

    The sequence of procedure calls corresponds to a preorder traversal of the activation tree. The sequence of procedure returns corresponds to a postorder traversal of the activation tree.

    Practice Next