Case2 : If root data is equal to search node
if ( root . data == searchNode ) { Console . Write ( " inorder ▁ successor ▁ of ▁ " + searchNode + " ▁ is : ▁ " ) ; if ( pre . pNode != null ) Console . WriteLine ( pre . pNode . data ) ; else Console . WriteLine ( " null " ) ; } pre . pNode = root ; if ( root . left != null ) inOrderSuccessorOfBinaryTree ( root . left , pre , searchNode ) ; }