gmo61520

Untitled

Mar 12th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def calculate_width(vertice):
  2. if vertice == None: return 0
  3. return 1 + calculate_width(vertice[1]) + calculate_width(vertice[2])
  4.  
  5. def calculate_height(vertice):
  6. if vertice == None: return 0
  7. return 1 + max(calculate_height(vertice[1]), calculate_height(vertice[2]))
  8.  
  9. def calculate_size(vertice):
  10. return calculate_width(vertice), calculate_height(vertice)
Advertisement
Add Comment
Please, Sign In to add comment