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