interactive-coding-challenges/graphs_trees/tree_height/height.py
2016-08-14 08:29:25 -04:00

7 lines
191 B
Python

class BstHeight(Bst):
def height(self, node):
if node is None:
return 0
return 1 + max(self.height(node.left),
self.height(node.right))