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 have constructed this representation of graph in 1st question)
2. You will be given two integer values a and b as, two vertices of the graph.
3. Also, a variable named factor, which denotes the value for which we have to find ceil and floor path.
4. You have to write a function named: CeilfloorPath() in which you have to find a path with the cost just greater than the factor(Ceil path) and path with the cost just smaller than the factor(Floor path).
5. 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 CeilfloorPath() function.
Input Format
1.First line consist of two integer values a (vertex1) and b (vertex2) . 2.Second line consist of an integer value as factor.
Output Format
void
Constraints
1. 0<=a,b<graphs size 2. 0<Factor<10^9.
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 40
Output
0-3-4-5-6@48 0-1-2-3-4-5-6@38