public class Solution {
public int TreeDepth(TreeNode root) {
// 预处理
if (root == null) return 0;
// 递归求子树最大深度
return Math.max(TreeDepth(root.left),TreeDepth(root.right)) + 1;
}
}

public class Solution {
public int TreeDepth(TreeNode root) {
// 预处理
if (root == null) return 0;
// 递归求子树最大深度
return Math.max(TreeDepth(root.left),TreeDepth(root.right)) + 1;
}
}