バイナリツリーLeetcodeの最大深さ(104)

件名の説明:

問題解決のアイデア:

コード:

public int MaxDepth(TreeNode root) { if (root == null) return 0; return Mathf.Max(MaxDepth(root.left) + 1, MaxDepth(root.right) + 1); }
出典:http://www.1994july.club/

おすすめ

転載: www.cnblogs.com/1994july/p/12148847.html