Undirected graph is given with the list of edges. Build an adjacency matrix. Print the number of ones in adjacency matri
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Undirected graph is given with the list of edges. Build an adjacency matrix. Print the number of ones in adjacency matri
Undirected graph is given with the list of edges. Build an adjacency matrix. Print the number of ones in adjacency matrix. Graph can contain multiple edges and loops. Input First line contains number of vertices n. Each of the next line contains one edge. Read the edges till the end of file. Output Build an adjacency matrix. Print the number of ones in adjacency matrix. Sample input 3 1 2 23 22 32 Sample output 5