Find the Connected Component in the Undirected Graph(LintCode 431):

Problem