I understand the concept of in order traversal for BST, but I am confused on how the recursion for it works. I am confused as to how the print statement and the recursion call with root.right as a parameter will ever be ran. I notice that inOder(root.left) will keep getting called to search to the lowest value in the BST, but when it reaches null then the if statement is unreachable, therefore we can't jump back to the right node. I just would like to know how we can possibly reach the bottom lines of code in the if statement.
public void inOrder(TreeNode root) {
if(root != null) {
inOrder(root.left);
System.out.printf("%d ",root.data);
inOrder(root.right);
}
}