mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update bt_height.py
This commit is contained in:
parent
91cd6134b6
commit
a78436b51b
@ -3,7 +3,9 @@
|
||||
# author: bt3gl
|
||||
|
||||
def height(root):
|
||||
|
||||
if not root:
|
||||
return -1
|
||||
return 0
|
||||
|
||||
return 1 + max(height(root.left), height(root.right))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user