当前位置:网站首页>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);
}边栏推荐
- How to restore visualizations and dashboards after kibana rebuilds the index
- RTSP/ONVIF协议视频平台EasyNVR启动服务报错“service not found”,该如何解决?
- Top 25 most popular articles on vivo Internet technology in 2021
- Tencent cloud account related
- Set the time zone in ci4 (CodeIgniter 4)
- Quickly create a consumer cluster
- 6、 Web Architecture Design
- ArcLayoutView: 一个弧形布局的实现
- [cloud computing] GFS ideological advantages and architecture
- Qualcomm 9x07 two startup modes
猜你喜欢

Linux MySQL installation

Point cloud library PCL from introduction to mastery Chapter 10

渲染效果图哪家好?2022最新实测(四)

【云计算】GFS思想优势以及架构

Summary of communication mode and detailed explanation of I2C drive

636. Exclusive Time of Functions

【论文笔记】Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection*

The first day of employment more than ten years ago

Open source technology exchange batch stream integrated data synchronization engine Chunjun data restore DDL function module analysis

What are the PCB characteristics inspection items?
随机推荐
Azure Active Directory brute force attack
6、 Web Architecture Design
Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala
6-shining laser application of calayer
Optimize your gradle module with a clean architecture
Jetpack family - ViewModel
6月《中国数据库行业分析报告》发布!智能风起,列存更生
When easynvr service is started, video cannot be played due to anti-virus software interception. How to deal with it?
kibana 重建index后,如何恢复Visualizations和 Dashboards
3-ProgressBar和二次裁剪
Qualcomm 9x07 two startup modes
[cloud computing] GFS ideological advantages and architecture
Lightweight UI control library worth collecting
Unique paths II of leetcode topic analysis
523. Continuous Subarray Sum
[QNX Hypervisor 2.2用户手册]6.1 使用QNX Hypervisor系统
C Advanced Learning -- extended method (this)
usb peripheral 驱动 - configfs
Deep analysis and Simulation of vector
Top 25 most popular articles on vivo Internet technology in 2021