Find minimum and maximum value in the path from LCA to a
for ( ; i < Path1 . size ( ) ; i ++ ) { if ( min1 > Path1 . get ( i ) ) min1 = Path1 . get ( i ) ; if ( max1 < Path1 . get ( i ) ) max1 = Path1 . get ( i ) ; }