Driven Program
int main ( ) { int n = 10 ; vector < int > tree [ n + 2 ] ; tree [ 1 ] . push_back ( 3 ) ; tree [ 3 ] . push_back ( 1 ) ; tree [ 1 ] . push_back ( 6 ) ; tree [ 6 ] . push_back ( 1 ) ; tree [ 1 ] . push_back ( 2 ) ; tree [ 2 ] . push_back ( 1 ) ; tree [ 3 ] . push_back ( 4 ) ; tree [ 4 ] . push_back ( 3 ) ; tree [ 6 ] . push_back ( 8 ) ; tree [ 8 ] . push_back ( 6 ) ; tree [ 2 ] . push_back ( 7 ) ; tree [ 7 ] . push_back ( 2 ) ; tree [ 2 ] . push_back ( 5 ) ; tree [ 5 ] . push_back ( 2 ) ; tree [ 4 ] . push_back ( 9 ) ; tree [ 9 ] . push_back ( 4 ) ; tree [ 4 ] . push_back ( 10 ) ; tree [ 10 ] . push_back ( 4 ) ; cout << minEdge ( tree , n ) << endl ; return 0 ; }