当前位置:网站首页>Sword finger offer 55 - I. depth of binary tree
Sword finger offer 55 - I. depth of binary tree
2022-07-18 20:54:00 【anieoo】
Original link : The finger of the sword Offer 55 - I. The depth of the binary tree
solution:
dfs
class Solution {
public:
int maxDepth(TreeNode* root) {
if(root == NULL) return 0;
int left = maxDepth(root->left);
int right = maxDepth(root->right);
return max(left, right) + 1;
}
};边栏推荐
猜你喜欢

这些用例设计题,你在面试时遇到过吗?
![[uniapp calls wechat Payment] uniapp development applet - call wechat payment](/img/a1/52e3acf6448c509d34ae135bae1402.png)
[uniapp calls wechat Payment] uniapp development applet - call wechat payment

YOLOv5改进之二十:Involution新神经网络算子引入网络
![[亲测有效]npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.](/img/07/9f43b0b8ea0c887900d4daa351f1f8.png)
[亲测有效]npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

Three ways for industrial parks to enhance the service capacity of enterprises

【企业微信自建应用开发】

Basic research on Chang'an chain TLS
![[Xuelang download tutorial] 03 proxifier settings for Xuelang Download](/img/d0/dec93042aca6fe15564164074b6215.png)
[Xuelang download tutorial] 03 proxifier settings for Xuelang Download

Unity-2d pixel lattice ablation

Remember these points and you can quickly find bugs
随机推荐
How to do fine operation management in industrial parks
EPIC-KBS9工控机刷机文档
YOLOv5改进之二十:Involution新神经网络算子引入网络
Unity-2d pixel lattice ablation
Metrics study notes
Markdown 基本语法格式
整蛊小程序(宝宝,我是天下第一大傻X)代码
Termux related
Code that programmers can't understand gradually fade out 1920-500 (1)
Taote keyword search commodity API interface (commodity list interface, sales volume sorting interface, commodity sales volume interface)
Have you met these use case design questions during the interview?
高数下|二重积分的计算1|高数叔|手写笔记
Little sister, I'm coming
Apache log related
Installation and deployment series (I) -- docker compose installation of redis cluster cluster
待处理问题
Improvement 20 of yolov5: introduction of new neural network operator into network
【ui-app移动端UI框架】
Applet page navigation
SF city test development side 49min answer