Question: I need help with reading in a complete undirected graph in c + + . the file given to us represents a complete undirected graph
I need help with reading in a complete undirected graph in c
the file given to us represents a complete undirected graph forming a lower trianglular matrix. You should be able to reflect along the diagonal to complete your graph.
Here is my current not working implementation.
vector graph;
int distance;
while inputFile distance
vector row;
Read distances until a zero is encountered
while distance
row.pushbackdistance;
inputFile distance;
Add the row to the graph
graph.pushbackrow;
Here are a few lines from the node graph
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
