Undirected Graph Size
Create a public class named
GraphSize that provides a single static method
size receives an unweighted graph containing
Integer values using
cs1.graphs.UnweightedGraph, so an
To complete this problem you'll need to implement graph traversal.
From a given node, you want to visit all of its neighbors except any nodes that you've already visited.
If you use a
Set to track the nodes that you've visited, then you can simply return the size of that
you are finished.
We've provided some starter code to get you off on the right track.
cs1.graphs.UnweightedGraph has the following public properties:
cs1.graphs.GraphNode has the following public properties: