Rename bst_find_successor_inorder.py to bst_sucessor_two_nodes.py

This commit is contained in:
bt3gl 2023-08-08 15:31:45 -07:00 committed by GitHub
parent 5d56bb3855
commit 23c20d4aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,18 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def find_successor(root, p):
successor = None
while root:
if root.val <= p.val:
root = root.right
else:
successor = root
root = root.left
return successor