Algorithms, Data Structures, DFS, Bfs, Graphs.
with the description of the problem (from interviewbit.com) : Given a graph with A nodes. The edges in graph are given in a 2D array B. There is an undirected edge between B[i][0] and B[i][1]. Find the number of connected components in the given graph. Problem constraints: 1 <= A <= 105 1 <= |B| <=