>>3
Choose a random vertex. Run either a breadth-first or a depth-first search from that vertex. When search terminates, your 'visited' set contains a connected component of the graph.
If you want to split the graph into all connected components, keep the 'not visited set' as well, after step 1 terminates pick any vertex from it, repeat.
If you want to manage connected components in a dynamic graph, look at
http://en.wikipedia.org/wiki/Disjoint-set_data_structure