Add a private method to the myGraph class called isEdge that takes two vertices and returns true if the vertices are connected by an edge and returns false otherwise. Use the following function header:
boolean isEdge(int i, int j)Note that this function assumes that it is being given the indices corresponding to the two vertices, and not their names.
Then add a public method to the myGraph class, also called isEdge which behaves like the above described method, except that it takes vertex names, instead of vertex indices, as arguments. Use the following function header:
boolean isEdge(String u, String v)Note that the public isEdge method can simply call the private isEdge to accomplish its purpose.