Skip to content

Instantly share code, notes, and snippets.

@AdelinGhanaem
Created July 4, 2016 06:40
Show Gist options
  • Select an option

  • Save AdelinGhanaem/130e28fd806fe275df0cbc9f471aae05 to your computer and use it in GitHub Desktop.

Select an option

Save AdelinGhanaem/130e28fd806fe275df0cbc9f471aae05 to your computer and use it in GitHub Desktop.
public class InOrder {
public void traverse(Node root) {
if (root == null) {
return;
}
traverse(root.getLeft());
System.out.print(root.getValue()+" > ");
traverse(root.getRight());
}
public static void main(String[] strings) {
Node root = SimpleTreeFactory.get();
InOrder inOrder = new InOrder();
inOrder.traverse(root);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment