Implementation requirements Connectivity must be tested using a linear time algo
ID: 656074 • Letter: I
Question
Implementation requirements
Connectivity must be tested using a linear time algorithm such as the depth-first and breadth-first search algorithms discussed in class.
Program Input
Your program must read the description of the network from the standard input. The description starts with a line containing the number n of nodes and the number m of links in the network, where n and m are non-negative integers. Each of the following m lines contains a pair of integers between 0 and n-1, corresponding to the two ends of a communication link.
Program Output
You must print to the standard output a newline terminated line containing the message "connected" if the input network is connected, and "not connected" if the input network is not connected.
Sample Input 1:
An input representing the network in the figure above is:
Output for Sample Input 1:
Sample Input 2:
Output for Sample Input 2:
Explanation / Answer
#include<stdio.h>
#include<conio.h>
int main()
{int Desc[20],n,m;
printf(