if required node ' x ' is present then print the path
if ( hasPath ( root , arr , x ) ) { for ( int i = 0 ; i < arr . size ( ) - 1 ; i ++ ) cout << arr [ i ] << " - > " ; cout << arr [ arr . size ( ) - 1 ] ; }