Leetcode: Number of Connected Components in an Undirected Graph
Givennnodeslabeledfrom0ton-1andalistofundirectededges(eachedgeisapairofnodes),writeafunctiontofindthenumberofconnectedcomponentsinanundirectedgraph.
Example1:
03
||
1---24
Givenn=5andedges=[[0,