A utility function to test above functions
void test ( Node * root , int k ) { Node * nr = nextRightNodeUtil ( root , k ) ; if ( nr != NULL ) cout << " Next ▁ Right ▁ of ▁ " << k << " ▁ is ▁ " << nr -> key << endl ; else cout << " No ▁ next ▁ right ▁ node ▁ found ▁ for ▁ " << k << endl ; }