1. You will be given an graph represented in form of ArrayList<ArrayList<edge>>, where edge
is a user defined class (a type) which contains three Integer data members:
1st : v1 (denotes) vertex1.
2nd : v2 (denotes) vertex2.
3rd : wt (denotes the weight of edge b/w v1 and v2).
(we constructed this representation of graph in 1st question)
2. You will be given two Integer values a and b.
3. You have to complete maxCostPath() function, which returns the maximum cost path from vertex a to vertex b.
4. You will need an extra parameter here so you have to declare that extra parameter in main and then replace it with ?(question mark sign) in main and maxCostPath() function.
Input Format
1.First line consist of two integer values a (vertex1) and b (vertex2) .
Output Format
A Integer (representing the max cost from source a to destination b).
Constraints
0<=a,b<graph size
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
0 6
Output
50