public static void preorder(Node root) {
if(root == null) return;
root.printValue();
preorder(root.getLeft());
preorder(root.getRight());
}
I have tried to go through this function numerous times but i still can't figure out how after traversing through all the left children the algorithm goes back to the nearest ancestor(parent). Could someone explain this to me.