UVa 459 - Graph Connectivity

459 - Graph Connectivity
459 - Graph Connectivity

Explanation
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 archieve this number.

Input
1

E AB CE DB EC

Output
2