2022年10月8日

day16 104,222

摘要: ###104. 二叉树的最大深度 class Solution { //层序遍历 public int maxDepth(TreeNode root) { if(root==null){ return 0; } Queue<TreeNode> que=new LinkedList<>(); que. 阅读全文

posted @ 2022-10-08 11:39 你是千堆雪我是长街7 阅读(10) 评论(0) 推荐(0)

day17 110

摘要: ###110平衡二叉树 class Solution { public boolean isBalanced(TreeNode root) { return (getHeight(root)!=-1); //返回值是一个int 类型 左右子树的最大高度 } public int getHeight( 阅读全文

posted @ 2022-10-08 11:14 你是千堆雪我是长街7 阅读(9) 评论(0) 推荐(0)

导航