标签:
题目:
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Tree Depth-first Search
链接: http://leetcode.com/problems/maximum-depth-of-binary-tree/
一刷
1 class Solution(object): 2 def maxDepth(self, root): 3 if not root: 4 return 0 5 return max(self.maxDepth(root.left), self.maxDepth(root.right)) + 1
104. Maximum Depth of Binary Tree
标签:
原文地址:http://www.cnblogs.com/panini/p/5597223.html