Question: write a C++ program 2. (60pts) Adjacency matrix can be used to represent graphs. Use adjacency matrix to implement the following operations on graph. Print
write a C++ program

2. (60pts) Adjacency matrix can be used to represent graphs. Use adjacency matrix to implement the following operations on graph. Print out the adjacency matrix. Undirected graph: (a) Create the undirected graph as a n-by-n matrix, where n is the number of nodes. You can use 2-d array to represent the matrix. Initialize all entries to be 0 (b) Add an edge between node i and j, (c) Remove an edge between node i and j. Directed graph: (d) Create the graph using adjacency matrix. (e) Add an edge from node i toj (f) Remove an edge from node i to j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
