Python 版
def TreeDeep(self, pRoot):
if pRoot == None:
return 0
left = self.TreeDeep(pRoot.left)+1
right = self.TreeDeep(pRoot.right)+1
return left if left>right else right
def TreeDeep(self, pRoot):
if pRoot == None:
return 0
left = self.TreeDeep(pRoot.left)+1
right = self.TreeDeep(pRoot.right)+1
return left if left>right else right