Select the code snippet which performs post-order traversal.

Select the code snippet which performs post-order traversal.
A.
Code:
public void postorder(Tree root)
{
	System.out.println(root.data);
	postorder(root.left);
	postorder(root.right);
}
B.
Code:
public void postorder(Tree root)
{
	postorder(root.left);
	postorder(root.right);
	System.out.println(root.data);
}
C.
Code:
public void postorder(Tree root)
{
	System.out.println(root.data);
	postorder(root.right);
	postorder(root.left);
}
D.
Code:
public void postorder(Tree root)
{
	postorder(root.right);
        System.out.println(root.data);
	postorder(root.left);
}
 

Tìm kiếm

Back
Top