Concept Flow - BST Inorder Successor
Start at root
Search for target node
Found target node?
No→Return null
Yes
Does target have right child?
Yes→Go to right child
Go left as far as possible
Leftmost node is successor
No
Go up to ancestor where target is in left subtree
That ancestor is successor
Return successor
Find the node's inorder successor by checking right subtree or ancestors.
