add note on height

This commit is contained in:
marina 2023-08-03 15:50:59 -07:00 committed by GitHub
parent 46b4f11520
commit 177914c7be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,18 @@
<br> <br>
#### find height
<br>
```python
def height(root):
if not root:
return -1
return 1 + max(height(root.left), height(root.right))
````
<br>
---- ----