Concept Flow - BST Inorder Successor
Start at root node
Search for target node
Found target node?
No→Return null (no successor)
Yes
Does target have right child?
Yes→Go to right child
Find leftmost node in right subtree
Go up to ancestor where target is in left subtree
Return that ancestor as successor
Done
Find the inorder successor by first locating the target node, then either going to its right subtree's leftmost node or moving up to the nearest ancestor where the target is in the left subtree.
