当前位置:网站首页>2022.6.22-----leetcode. five hundred and thirteen
2022.6.22-----leetcode. five hundred and thirteen
2022-06-23 08:52:00 【Lu 727】
int maxh;// Maximum height
int ans;
public int findBottomLeftValue(TreeNode root) {
maxh=0;
ans=root.val;
dfs(root,0);
return ans;
}
// Depth-first search , Record the current height
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);
}边栏推荐
- 297. Serialize and Deserialize Binary Tree
- New engine, new capability, new experience, Tencent host security flagship release
- Unity grid programming 06
- How to restore visualizations and dashboards after kibana rebuilds the index
- node request模块cookie使用
- Which one is better for rendering renderings? 2022 latest measured data (IV)
- The most commonly used 5-stream ETL mode
- 636. Exclusive Time of Functions
- Single core driver module
- Analysis of JMeter pressure measurement results
猜你喜欢

Summary of communication mode and detailed explanation of I2C drive

谈谈 @Autowired 的实现原理

Qualcomm 9x07 two startup modes

The first day of employment more than ten years ago

【活动报名】SOFAStack × CSDN 联合举办开源系列 Meetup ,6 月 24 日火热开启

Flink错误--Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered “time“

636. Exclusive Time of Functions

Monitor the cache update of Eureka client

Geoserver添加mongoDB数据源

636. Exclusive Time of Functions
随机推荐
986. Interval List Intersections
125. Valid Palindrome
【学习资源】理解数学和热爱数学
usb peripheral 驱动 - debug
Balls and cows of leetcode topic analysis
【云原生 | Kubernetes篇】Kubernetes原理与安装(二)
【云计算】GFS思想优势以及架构
Self organizing map neural network (SOM)
[QNX Hypervisor 2.2用户手册]6.1 使用QNX Hypervisor系统
297. Serialize and Deserialize Binary Tree
Third party payment in the second half: scuffle to symbiosis
The first day of employment more than ten years ago
523. Continuous Subarray Sum
Restore the default routing settings of the primary network card
kernel log调试方法
史上最污技术解读,60 个 IT 术语我居然秒懂了......
Leetcode topic analysis sort colors
Lighthouse cloud desktop experience
3-progressbar and secondary cropping
[operating steps] how to set the easynvr hardware device to be powered on without automatic startup?