递归不解释
class Solution:
"""
@param root: The root of binary tree.
@return: An integer
"""
def maxDepth(self, root):
# write your code here
if root == None:
return 0
lh = self.maxDepth(root.left)
rh = self.maxDepth(root.right)
return max(lh,rh)+1