diff --git a/trees/bt_height.py b/trees/bt_height.py index 65fa688..bb16d53 100644 --- a/trees/bt_height.py +++ b/trees/bt_height.py @@ -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))