#include #include #include #include #include "StringGraph.h" using namespace std; int main() { cout <<"Now let's build a graph!\n"; cout <<"Enter the number of nodes in the graph:"; int N; do{ cin >> N; } while (N<=0); //Read in nodes string * nodes = new string[N]; for (int i=0;i> nodes[i]; } //Directed or not cout <<"Is it directed or not (Y/N)"; char answer; do { cin >> answer; } while (answer!='Y' && answer!='N'); Graph graph(nodes,N,answer=='Y'); //if answer=='Y' directed //read in edges cout <<"Enter the number of edges: "; int M; do { cin >> M; } while (M<0); string fromNode, toNode; for (int i=0;i> fromNode; cout <<"to which node:"; cin >> toNode; graph.AddEdge (fromNode, toNode); } graph.Display(); graph.BFS_Explore (nodes[0]); }