Skip to content

Instantly share code, notes, and snippets.

@xnorcode
Created October 7, 2018 22:33
Show Gist options
  • Save xnorcode/007de358ab6094e241eda9daf791fe4b to your computer and use it in GitHub Desktop.
Save xnorcode/007de358ab6094e241eda9daf791fe4b to your computer and use it in GitHub Desktop.
Depth-First Search Post-Order traversal
...
// DFS post-order print of all values in BST
static void printPostOrder(Node current){
// print left child
if(current.left != null) printInOrder(current.left);
// print right child
if(current.right != null) printInOrder(current.right);
// print current node data
System.out.println(current.data);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment