Sail E0 Webinar
Question
Select the code snippet that performs post-order traversal iteratively.
Options:
A .  public void postorder(Tree root){        if (root == null)        return;
B .  public void postorder(Tree root){        if (root == null)        return;
C .  public void postorder(Tree root){        if (root == null)            return;
D .  None of the mentioned
Answer: Option B


The left and right children are added first to the stack, followed by the node, which is then popped. Post-order follows LRN policy.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers