后序遍历
/** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } */ public class Solution { public int TreeDepth(TreeNode root) { return postOrder(root); } public int postOrder(TreeNode root){ if(root == null){ return 0; } int left = postOrder(root.left); int right = postOrder(root.right); return Math.max(left,right)+1; } }