Update bs_sucessor_and_precessor.py

This commit is contained in:
bt3gl 2023-08-08 15:39:55 -07:00 committed by GitHub
parent 27f5ce1c6f
commit 122a535241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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