import java.util.*;
public class Solution {
int height = 0;
public int TreeDepth(TreeNode root) {
if(root == null){
return 0;
}
int left = TreeDepth(root.left);
int right = TreeDepth(root.right);
height = Math.max(left,right) + 1;
return height;
}
}
1万+

被折叠的 条评论
为什么被折叠?



