Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 5108f54

Browse files
Update bs_sucessor_and_precessor.py
1 parent 0264d26 commit 5108f54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

trees/bs_sucessor_and_precessor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def successor(root):
77

88
root = root.right
9-
while root.left:
9+
while root:
1010
root = root.left
1111

1212
return root
@@ -15,7 +15,7 @@ def successor(root):
1515
def predecessor(root):
1616

1717
root = root.left
18-
while root.right:
18+
while root:
1919
root = root.right
2020

2121
return root

0 commit comments

Comments
 (0)