#采用递归方法 ''' 自底向上递归 遍历root根节点左右节点, 每遍历一次,+1 ''' # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def TreeDepth(self, pRoot): if pRoot is None: return 0 # 得到左右子树中较大的子树深度 return max(self.TreeDepth(pRoot.left),self.Tr...