当前位置:网站首页>2022.6.22-----leetcode.513
2022.6.22-----leetcode.513
2022-06-23 08:31:00 【路Lu727】
int maxh;//最大高度
int ans;
public int findBottomLeftValue(TreeNode root) {
maxh=0;
ans=root.val;
dfs(root,0);
return ans;
}
//深度优先搜索,记录当前高度
void dfs(TreeNode n,int h){
if(n==null) return;
if(h>maxh){
maxh=h;
ans=n.val;
}
dfs(n.left,h+1);
dfs(n.right,h+1);
}边栏推荐
猜你喜欢

6月《中國數據庫行業分析報告》發布!智能風起,列存更生

jmeter压测结果分析

点云库pcl从入门到精通 第十章

In June, China database industry analysis report was released! Smart wind, train storage and regeneration

Talk about the implementation principle of @autowired

The most commonly used 5-stream ETL mode

Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala

为什么用生长型神经气体网络(GNG)?

论文阅读【Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset】

最常用的5中流ETL模式
随机推荐
[QNX Hypervisor 2.2用户手册]5.6.1 Guest关机时静默设备
List interface three sub implementation classes
The kernel fails to shut down when the easygbs program stops. How should I optimize it? [code attached]
Comprehensive analysis of news capture
How to evaluate code quality
Azure Active Directory brute force attack
Optimize your gradle module with a clean architecture
Leetcode topic analysis sort colors
最常用的5中流ETL模式
【云计算】GFS思想优势以及架构
Leetcode topic analysis group anagrams
史上最污技术解读,60 个 IT 术语我居然秒懂了......
TDesign update weekly report (the first week of January 2022)
2-用线段构成图形、坐标转换
There are some limitations in cluster expansion and contraction
Derivation and loading of the trained random forest model
Explanation on webrtc's stun/turn service in tsingsee green rhino video
Talk about the implementation principle of @autowired
4-绘制椭圆、使用定时器
Assembly (receive several n-digit decimal values (0~65535) from the keyboard and display their sum in different base numbers.)