// 前序遍历
public void preOrder(TreeNode root) {
if(root == null){
return;
}
System.out.print(root.val+" ");
preOrder(root.left);
preOrder(root.right);
}
// 前序遍历
public void preOrder(TreeNode root) {
if(root == null){
return;
}
System.out.print(root.val+" ");
preOrder(root.left);
preOrder(root.right);
}