当前位置:网站首页>Depth of binary tree
Depth of binary tree
2022-06-25 05:21:00 【Don't hit me, it hurts!】
subject

[ Simple 、 recursive ]
Answer key
Depth of tree = max( Left subtree depth , Right subtree depth )+1
function TreeDepth(pRoot)
{
// Recursive export
if(pRoot===null) return 0;
let left = TreeDepth(pRoot.left);
let right = TreeDepth(pRoot.right);
return 1 + (left>right?left:right);
}
And the method of hierarchical traversal , To be added ……
* Please quote from QW’s Blog!*
边栏推荐
- Try block and exception handling
- Google Earth engine (GEE) - Global jrc/gsw1_ 1 / batch download of yearlyhistory dataset (China region)
- Electronic Society C language level 1 28, character diamond
- Ctfhub eggs
- In depth understanding of line height and vertical align
- TeeChart Pro ActiveX 2022.1
- Route parameters to jump to the page and transfer parameters -- > hidden parameter list
- Charles and iPhone capture
- Laravel Aurora push
- Eyeshot Ultimate 2022 Crack By Xacker
猜你喜欢

Various pits encountered in the configuration of yolov3 on win10

IronOCR 2022.1 Crack

Essais de pénétration - sujets d'autorisation

Ranorex Studio 10.1 Crack

Go deep into the working principle of browser and JS engine (V8 engine as an example)
![[Huawei machine test] hj16 shopping list](/img/54/d28f5aea9350af7797ca7c069e564d.jpg)
[Huawei machine test] hj16 shopping list

Dynamic programming example 2 leetcode62 unique paths

Penetration test - right raising topic

TX Text Control 30.0 ActiveX

Two hours to take you into the software testing industry (with a full set of software testing learning routes)
随机推荐
Japanese fifty tone diagram
JSON Library Tutorial from scratch (III): parsing strings, learning and sorting notes
Laravel Vonage SMS sending
For in JS Of and for in
[pan Wai 1] Huawei computer test
Database overview
IronOCR 2022.1 Crack
cuda编译报错
[Huawei machine test] hj16 shopping list
TeeChart Pro ActiveX 2022.1
Abuse unlimited authorization -- is your address safe?
A summary of the experiment of continue and break in C language
Stack and Queue
Precise delay based on Cortex-M3 and M4 (systick delay of system timer can be used for STM32, aducm4050, etc.)
CTFHub-rce
Read the general components of antd source code
Uva1103 ancient pictograph recognition
Basic knowledge of web pages (URL related)
CTFHUB SSRF
API interface management setup -eolinker4.0