F1201-lecture1-180320-has-path

easy
  1. You will be given a 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 hasPath() function, which returns true if there exist a path b/w vertex a and vertex b else it returns false.
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 hasPath() function.	
                               
                               

Input Format

1.First line consist of two integer values a (vertex1) and b (vertex2) .

Output Format

boolean value (true or false).

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
true
Previous
F1201-lecture1-180320-construct-and-display
Next
F1201-lecture1-180320-print-all-paths

Related Questions