I have asked this question in one if the interview, I have worked on Graph(BFS/DFS) , but I am not sure how to modify program of finding number of connected components solution