当前位置:网站首页>Niuke-top101-bm36
Niuke-top101-bm36
2022-07-23 16:22:00 【A fish that eats cats】
public class Solution {
boolean sign = true;
public boolean IsBalanced_Solution(TreeNode root) {
TreeDepth(root);
return sign;
}
public int TreeDepth(TreeNode t){
if(t == null)
return 0;
int l = TreeDepth(t.left);
if(l == -1)
return -1;
int r = TreeDepth(t.right);
if(r == -1)
return -1;
if(Math.abs(l - r) > 1){
sign = false;
return -1;
}
return Math.max(l,r) + 1;
}
}
边栏推荐
- [2023 approved in advance] BOE
- 为什么使用opengaussjdbc的时候老是出现FATAL?(标签-数据库|关键词-user)
- Packaging and use of alamofire framework
- Cloud native (11) | kubernetes chapter kubernetes principle and installation
- 反转链表画图演示
- Éléments de base de la validation des haricots - 04
- Go 接口:深入内部原理
- AC自动机和Fail树
- 2022蓝帽杯初赛wp
- Redis sentinel mode
猜你喜欢

sqlnet.ora文件设置不对造成ORA-12154 、ORA-01017连接异常

Éléments de base de la validation des haricots - 04

Mysql—主从复制

2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case

【深入浅出向】从自信息到熵、从相对熵到交叉熵,nn.CrossEntropyLoss, 交叉熵损失函数与softmax,多标签分类

“1+1>10”:无代码/低代码与RPA技术的潜在结合

【2022新生学习】第二周要点

死锁的3种处理策略
![[cloud native] continuous integration and deployment (Jenkins)](/img/3a/2cd6f0c768bd920b3de6d4f5b13cd5.png)
[cloud native] continuous integration and deployment (Jenkins)

Origin of bean validation ----01
随机推荐
2022蓝帽杯初赛wp
为什么要造一个 UILabel ?( 复习两丫技术 )
Dark horse programmer - interface test - four day learning interface test - third day - advanced usage of postman, export and import of Newman case set, common assertions, assertion JSON data, working
将.calss文件转为.jar-idea篇
VRRP+MSTP配置详解【华为eNSP实验】
Vinka introduces high anti-interference vk36n series touch IC: vk36n1d, vk36n2p, vk36n3b, vk36n4i, easy to use
Another award | opensca was selected as the "top ten open source software products in the world" at the China Software Expo
[suctf 2018]multisql (MySQL precompiled)
It's too hard! Tencent T4 boss was still staying up late at 4 a.m. and was actually sorting out the distributed transaction notes
pgsql误删除pg_wal文件后,服务启动失败
七、jmeter发出请求的逻辑
(Zset) how is the underlying layer of redis stored with a hop table
TranslucentTB 推荐
New infrastructure of enterprise data in the era of digital transformation | love Analysis Report
W3C 推出去中心化标识符作为 Web 标准
Google Earth engine -- null value problem in image statistics
中年危机,35岁被退休,打工人拿什么来抗衡资本家?
满足多种按键的高性价比、高抗干扰触摸IC:VK3606D、VK3610I、VK3618I 具有高电源电压抑制比
Vinka推出高抗干扰VK36N系列触摸IC:VK36N1D,VK36N2P,VK36N3B,VK36N4I 使用便利
After Effects 教程,如何在 After Effects 中创建动画?