mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-23 00:41:19 -04:00
Rename bst_find_successor_inorder.py to bst_sucessor_two_nodes.py
This commit is contained in:
parent
5d56bb3855
commit
23c20d4aaa
1 changed files with 0 additions and 0 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue