mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
7 lines
191 B
Python
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)) |