Question: Design a program named RouteExist.java and implement the following method: public static boolean(String filename, String from, String to) The first parameter: filename contains multiple lines
Design a program named RouteExist.java and implement the following method:
public static boolean(String filename, String from, String to)
The first parameter: filename contains multiple lines and each line represents a route(bi-direction) between two locations. For example,
Manassas NOVA means a routes exists between Manassas and NOVA
This method is going to check if a route exists between from (the second parameter) and to (the third parameter), return true if a route exists, otherwise return false.
Sample data file:
A B
C B
E C
AA B
AA G
A K
K C
K P
P M
M X
M Y
H Q
K Q
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
