Graph Output
Graph Output
2 3
0 1 2 3
0 0 1 1 0
1 0 0 0 0
2 0 1 0 1
3 0 1 0 0
Scanf(“%d”,&gr[i][j])
2. Find the indegree and outdegree of a given node.
Input:
Node: 2
Output:
Indegree of 2 is 1 and outdegree of 2 is 2.
3. Find any self-loop in the graph.
4. Find whether there is a direct edge between two node:
Input:
Node 1: 2
Node 2: 3
Output:
Yes