First have count = total no.of vertices in a graph
Starts with a Vertex do BFS traversal, in BFS traversal decrease the count on detecting new vertex.
after getting over the BFS, check count=0 or not?
if count=0 ===> Connected otherwise not connected