# -*- coding:utf-8 -*-
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def TreeDepth(self, pRoot):
# write code here
self.depthinit()
if not pRoot:
return 0
self.depth +=1
self.depth += max(self.TreeDepth(pRoot.left),self.TreeDepth(pRoot.right))
return self.depth
def depthinit(self):
self.depth = 0