Rename find_inorder_successor.py to bst_find_inorder_successor.py

This commit is contained in:
marina 2023-08-03 13:16:23 -07:00 committed by GitHub
parent 57075bd388
commit e0d9624032
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_inorder_successor(root):
successor = None
while root:
if root.val <= p.val:
root = root.right
else:
successor = root
root = root.left
return successor