459 - Graph Connectivity
In this problem you have to print the number of Connected Components in a given graph. You can use Breadth-First Search or Depth-First Search algorithms in order to achieve this number.
One can also use Union-sets to find the number of connected components in the graph.
4 G E AB CE DB EC G AG BF Y AB CD EF FG
7 2 5 21