Concept Flow - BST Inorder Successor
Start at root
Find node with given key
Does node have right child?
Yes→Go to right child
Find leftmost node in right subtree
Go up to ancestor where node is in left subtree
Return this ancestor as inorder successor
The flow finds the node, then if it has a right child, successor is leftmost node in right subtree; else, go up to ancestor where node is in left subtree.