Given Edges
int Edges [ ] [ ] = { { 0 , 1 } , { 1 , 2 } , { 1 , 4 } , { 3 , 4 } , { 4 , 5 } } ; for ( int i = 0 ; i < edges . length ; i ++ ) edges [ i ] = new Vector < Integer > ( ) ; maximumCost ( 1 , - 1 , N , M , arr , Edges ) ; System . out . print ( ans ) ; } }