摘要:
package leetcode; public class offer_55_2 { public boolean isBalanced(TreeNode root) { if(root==null) { return true; } return isBalanced(root.left)&&i 阅读全文
posted @ 2022-03-19 11:19
一仟零一夜丶
阅读(14)
评论(0)
推荐(0)
摘要:
class Solution { public int maxDepth(TreeNode root) { return root==null?0:Math.max(maxDepth(root.left),maxDepth(root.right))+1; } } 阅读全文
posted @ 2022-03-19 10:36
一仟零一夜丶
阅读(20)
评论(0)
推荐(0)
摘要:
package leetcode; public class offer_55_1 { int count=0; int maxlength=0; public int maxDepth(TreeNode root) { backtrace(root); return maxlength; } pu 阅读全文
posted @ 2022-03-19 10:33
一仟零一夜丶
阅读(18)
评论(0)
推荐(0)
浙公网安备 33010602011771号