Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_height_max(self, A):
- if A == None:
- return 0
- if A.left == A.right == None:
- return 1
- left_height_max = 1 + self.get_height_max(A.left)
- right_height_max = 1 + self.get_height_max(A.right)
- return max(left_height, right_height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement