From 39922339a3adfae9b8ec3a7b063392fddb8f283b Mon Sep 17 00:00:00 2001 From: bt3gl <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:03:55 -0700 Subject: [PATCH] Update bst_is_balanced.py --- trees/bst_is_balanced.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trees/bst_is_balanced.py b/trees/bst_is_balanced.py index 7acb0b0..1d3772b 100644 --- a/trees/bst_is_balanced.py +++ b/trees/bst_is_balanced.py @@ -5,7 +5,7 @@ def height(root): - if not root: + if root is None: return -1 return 1 + max(height(root.left), height(root.right)) @@ -13,7 +13,7 @@ def height(root): def is_balanced(root): - if not root: + if root is None: return True return abs(height(root.left) - height(root.right)) < 2 and \