Skip to content

Instantly share code, notes, and snippets.

@crherlihy
Created November 21, 2015 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crherlihy/a139d6d32d5bec9abed4 to your computer and use it in GitHub Desktop.
Save crherlihy/a139d6d32d5bec9abed4 to your computer and use it in GitHub Desktop.
Preorder traversal
public static void preOrder (Node root)
{
if(root == null) return;
//inOrder(root.getLeft());
System.out.println(root.toString());
preOrder(root.getLeft());
preOrder(root.getRight());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment