F1201-lecture1-180320-kth-largest-path

easy
  . 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 kthLCostPath() function, which returns the kth largest cost path from vertex a to vertex b(suppose k is 3 so you have to return 3rd largest path in terms of cost).
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 kthLCostPath() function.
                               
                               

Input Format

1.First line consist of two integer values a (vertex1) and b (vertex2) . 2.Second line consist the value of k.

Output Format

A Integer and a String (representing the kth largest cost and path from source a to destination b).

Constraints

0<=a,b,k<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 5 
2
Output
0 -> 3 -> 4 -> 5 @ 45
Previous
F1201-lecture1-180320-ceil-and-floor-graphs
Next
F1201-lecture1-180320-hamiltonian-path-and-cycle

Related Questions