mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
5 lines
133 B
Python
5 lines
133 B
Python
|
def height(node):
|
||
|
if node is None:
|
||
|
return 0
|
||
|
return 1 + max(height(node.left),
|
||
|
height(node.right))
|