Unweighted Graph Is Undirected
Create a method named
isUndirected accepts an
cs1.graphs and should return
true if the graph is
Each node in the graph has a set of neighbors that you can retrieve representing links from that node to other nodes. If the graph is undirected, if there is a link from A to B then there is also a link from B to A. So if B is a neighbor of A, then A should also be a neighbor of B.
Note that you do not need to solve this problem recursively, since there is a concise iterative solution.
cs1.graphs.UnweightedGraph is declared somewhat like this:
cs1.graphs.GraphNode is declared somewhat like this: