Question: Write a program in C or Java to implement a graph using Adjacency Matrix Technique. -Ask user for the number of nodes and edges. -Then
Write a program in C or Java to implement a graph using Adjacency Matrix Technique.
-Ask user for the number of nodes and edges.
-Then ask for node label and edge label.
-Finally, ask for source and destination nodes for each edge (directed graph).
Based on the input, you need to construct the graph and perform the following operations.
a) If you input a node label, it should output in- and out-degree for the node
b) if you input an edge label, it should output its source destination nodes.
C) If you input a node label, it should output all incident edges for the node.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
