Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def get_height_max(self, A):
  2. if A == None:
  3. return 0
  4.  
  5. if A.left == A.right == None:
  6. return 1
  7.  
  8. left_height_max = 1 + self.get_height_max(A.left)
  9. right_height_max = 1 + self.get_height_max(A.right)
  10.  
  11. return max(left_height, right_height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement