Question: Write C + + code of this algorithm . choose the V 1 for the input Algorithm for Connectedness and Components: The following algorithm checks
Write code of this algorithm choose the V for the input
Algorithm for Connectedness and Components:
The following algorithm checks the connectedness of graphs.
S : Set and component count
S : Choose an arbitrary vertex of
S : Fuse all vertices in the neighbourhood with and call this vertex
S : If the number of vertices which are nonadjacent to is the same as that before the
fusion, then go to Step Otherwise, go to Step
S : Delete the vertex with all fused vertex from call this new graph
S : If has any vertex left in it then let clarrc and go to Step Otherwise, go to
Step
S : Print each with its vertices. Stop.
Example Consider the graph given in Figure :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
