Leetcode - 104. Maximum Depth of Binary Tree
此篇文章為我的解題紀錄,程式碼或許並不是很完善
Leetcode - 104. Maximum Depth of Binary Tree
解題思路
使用recursive算樹的深度,若是有子節點則再次呼叫函式並把自己的子節點傳進去,並從左右子節點內挑出最大深度
我滴程式碼
1 | /** |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GitalkFacebook Comments