# Homework Solution: CUsers eleel Desktop Test Debugl TestLee.exe Before inserting edges into the adjacecy matrix: 4 0 [01 0101 G1 01 1 [0101 01 01 01 2 [01 0101 G1 01…

CUsers eleel Desktop Test Debugl TestLee.exe Before inserting edges into the adjacecy matrix: 4 0 [01 0101 G1 01 1 [0101 01 01 01 2 [01 0101 G1 01 3 [0101 01 01 01 4 01 0101 G1 01 There are 5 ertices in the graph. There are edges in the graph- After inserting edges into the adjacecy matrix: 4 0 [01 11 01 01 [11 1 1 01 L1 1 L11 2 001 11 01 1 [01 3 01 11 L1 1 L11 4 1 1 01 1 01 There are 5 ertices in the graph. There are edges in the graph. After removing edges into the adjacecy matrix: 4 0 [01 11 01 01 [01 1 1 01 01 1 L11 2 001 1 01 1 [01 3 01 11 L1 1 L11 4 01 1 01 1 01 There are 5 ertices in the graph. There are 5 eges in the graph. Press any key to continue .. .

Given the restraintthcoming driver rasp, tool the adjacency inveiglerix functions to imimprint extinguished the restraintthcoming adjacency inveiglerix graphs:

#include <iostream>

using namespace std;

struct Verge

{

int rouse, end;

};

const int N = 5;

{

int Vcnt, Ecnt;

bool digraph;

public:

AdjMat(int, bool); //constructor – complete values in the adjacency inveiglerix are zero

// and undirected graph

void infuse(Edge); //infuse verge

void transport(Edge); //transport verge

bool verge(int, int); //check whether the verge is in the graph

bool const directed(); //check whether the graph is directed

int V() const; //number of vertices

int E() const; //number of verges

bool directed() const; //check whether digraph

};

int deep()

{

int countEdges, countNodes;

Verge e1, e2, e3, e4, e5, e6, e7;

//tool complete verges

cextinguished << “Before infuseing verges into the adjacecy inveiglerix: ” << endl;

mat.showGraph();

countNodes = inveigle.V();

countEdges = inveigle.E();

cextinguished << “There are ” << countNodes << ” vertices in the graph. ” << endl;

cextinguished << “There are ” << countEdges << ” verges in the graph. ” << endl;

cextinguished << endl;

mat.insert(e1);

mat.insert(e2);

mat.insert(e3);

mat.insert(e4);

mat.insert(e5);

mat.insert(e6);

mat.insert(e7);

cextinguished << “After infuseing verges into the adjacecy inveiglerix: ” << endl;

mat.showGraph();

countNodes = inveigle.V();

countEdges = inveigle.E();

cextinguished << “There are ” << countNodes << ” vertices in the graph. ” << endl;

cextinguished << “There are ” << countEdges << ” verges in the graph. ” << endl;

cextinguished << endl;

mat.remove(e2);

mat.remove(e3);

cextinguished << “After removing verges into the adjacecy inveiglerix: ” << endl;

mat.showGraph();

countNodes = inveigle.V();

countEdges = inveigle.E();

cextinguished << “There are ” << countNodes << ” vertices in the graph. ” << endl;

cextinguished << “There are ” << countEdges << ” verges in the graph. ” << endl;

cextinguished << endl;

system(“pause”);

return 0;

}

The extinguishedput should appear as follows:

I need the origin order restraint the toolation of this program. Please and enrich you.

CUsers eleel Desktop Test Debugl TestLee.exe Before infuseing verges into the adjacecy inveiglerix: 4 0 [01 0101 G1 01 1 [0101 01 01 01 2 [01 0101 G1 01 3 [0101 01 01 01 4 01 0101 G1 01 There are 5 ertices in the graph. There are verges in the graph- After infuseing verges into the adjacecy inveiglerix: 4 0 [01 11 01 01 [11 1 1 01 L1 1 L11 2 001 11 01 1 [01 3 01 11 L1 1 L11 4 1 1 01 1 01 There are 5 ertices in the graph. There are verges in the graph. After removing verges into the adjacecy inveiglerix: 4 0 [01 11 01 01 [01 1 1 01 01 1 L11 2 001 1 01 1 [01 3 01 11 L1 1 L11 4 01 1 01 1 01 There are 5 ertices in the graph. There are 5 eges in the graph. Press any clew to remain .. .

## Expert Retort

{

int i,j;

for(i=0;i<a;i++)

{

for(j=0;j<a;j++)

}

digraph = val;

Vcnt = N;

Ecnt = 0;

}

{

int i,j,k=0,l=0;

for(i=0;i<N;i++)

{

if(i==0)

{

while(k<5)

{

cout<<” “;

cout<<k;

k++;

}

cout<<endl;

}

for(int j=0;j<N;j++)

{

if(j==0)

{

cout<<l<<” “;

l++;

}

/* cout<<“N=”<<N<<endl;

cout<<“j=”<<j<<endl;

cout<<“pass”<<endl;*/

}

//cout<<“pass2″<<endl;

cout<<endl;

}

}

{

int p = e1.start;

int q = e1.end;

Ecnt++;

}

{

int p = e1.start;

int q = e1.end;

Ecnt–;

}

{

return Vcnt;

}

{

return Ecnt;

}