mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-03 16:08:02 +00: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)) |