Skip to content

Commit 6d2bcde

Browse files
committed
sync post with code
1 parent f08f979 commit 6d2bcde

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

algorithms/binary_tree.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ def delete(self, data):
6161
if children_count == 0:
6262
# if node has no children, just remove it
6363
# check if it is not the root node
64-
if parent:
65-
if parent.left is node:
66-
parent.left = None
67-
else:
68-
parent.right = None
64+
if parent.left is node:
65+
parent.left = None
66+
else:
67+
parent.right = None
6968
del node
7069
elif children_count == 1:
7170
# if node has 1 child

0 commit comments

Comments
 (0)