Re: [闲聊] 每日LeetCode

楼主: SecondRun (雨夜琴声)   2023-02-16 09:18:25
104. Maximum Depth of Binary Tree
找出一棵二元树的max depth
C# code
public class Solution {
public int MaxDepth(TreeNode node) {
if (node == null) return 0;
return 1+Math.Max(MaxDepth(node.left),MaxDepth(node.right));
}
}
作者: a9486l (a9486l)   2022-02-16 09:18:00
大师
作者: Rushia (みけねこ的鼻屎)   2023-02-16 09:21:00
撞车
楼主: SecondRun (雨夜琴声)   2023-02-16 09:21:00
笑了
作者: MurasakiSion (紫咲シオン)   2023-02-16 09:24:00
大师
作者: idiont (supertroller)   2023-02-16 11:23:00
大师

Links booklink

Contact Us: admin [ a t ] ucptt.com