function that prints the inorder successor of a target node . next will point the last tracked node , which will be the answer .
void inorderSuccessor ( Node * root , Node * target_node , Node * & next ) {