I wanted to wite a code which shows EulerTour in a binary tree. I have written code below:
public void EulerTour(Node parent , Node focusNode)
{
if(focusNode.left!= null)
EulerTour(parent, focusNode.left);
if(focusNode.right!= null)
EulerTour(parent, focusNode.right);
System.out.println(focusNode);
}
but I have 3 Questions :
Is it right for Euler Tour??
If yes, It seems to be very similar to postOrder Traverse of tree. right?
If it is similar to post Order traverse so what are the differences that we use 2 seperated code?
Thanks in advance
Here are C++ codes