Question: #Course: C programming language & Algorithm Problem Statement: Hints: For Circuit Free graph; First Step: Suppose A tree is given. The user can take the
#Course: C programming language & Algorithm
Problem Statement: Hints: For Circuit Free graph;
First Step: Suppose A tree is given. The user can take the node number as per choice Node contain letter edge number as per choice and set the connection of the edge as per choice. The initial component number of each node will be
Second Step: Then the BFS algorithm will run on the entire tree and print the BFS results with component number of all nodes.
Third Step: Then any two nodes will be chosen from the user's choice for checking component number. If both nodes component number is same then print "Same component" and if both nodes component number is not same then print "Different component".
Fourth Step: After that, any edge will be removed from the user as per hisher wish. After edge delete, the tree splits into two parts. One is big tree and another is small tree. Old trees component number will be for every node. New trees component number will be for every node.
Fifth Step: Then again BFS will be started again from both endpoints of deleted edge at the same time which is called Alternative BFS Also show the BFS result for both parallel. It means when BFS first runs for new tree from endpoints of deleted edge and show the first BFS node for new tree then BFS jumps to old tree and then BFS runs for old tree from endpoints of deleted edge and show the first BFS result. Then again BFS jumps to new tree and again show second BFS node and after that jumps to old tree and show the result. Whole process will continue one after another like parallel. It BFS stops for both tree when one of trees BFS is fully finished trees
Sixth Step: After Alternative BFS user can check component number again. So any two nodes will be chosen from the user's choice for checking component number. If both nodes component number is same then print "Same component" and if both nodes component number is not same then print "Different component".
Complete every step.
Write & solve the whole problem statement in C programming language code.
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
