Skip to content

Instantly share code, notes, and snippets.

@xnorcode
Last active October 7, 2018 22:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save xnorcode/21a758d9c8f88ba79e583a51512f50fc to your computer and use it in GitHub Desktop.
Depth-First Search In-Order traversal
...
// DFS in-order print of all values of BST
static void printInOrder(Node current){
// print left child
if(current.left != null) printInOrder(current.left);
// print current node data
System.out.println(current.data);
// print right child
if(current.right != null) printInOrder(current.right);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment