Bootstrap

[算法导论] 104. 二叉树的最大深度

0. 题目

1. 递归 o(n) o(height)

class Solution(object):
    def maxDepth(self, root):
        if not root:    return 0
        return max(self.maxDepth(root.left),self.maxDepth(root.right))+1