Tuyết Trinh Nguyễn
New member
Select the code snippet which performs post-order traversal.
A.
B.
C.
D.
A.
Code:
public void postorder(Tree root)
{
System.out.println(root.data);
postorder(root.left);
postorder(root.right);
}
Code:
public void postorder(Tree root)
{
postorder(root.left);
postorder(root.right);
System.out.println(root.data);
}
Code:
public void postorder(Tree root)
{
System.out.println(root.data);
postorder(root.right);
postorder(root.left);
}
Code:
public void postorder(Tree root)
{
postorder(root.right);
System.out.println(root.data);
postorder(root.left);
}