Update bs_sucessor_and_precessor.py

This commit is contained in:
bt3gl 2023-08-08 20:00:05 -07:00 committed by GitHub
parent 0264d26b7e
commit 5108f546c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
def successor(root):
root = root.right
while root.left:
while root:
root = root.left
return root
@ -15,7 +15,7 @@ def successor(root):
def predecessor(root):
root = root.left
while root.right:
while root:
root = root.right
return root