Computer Science homework Assignment
HINTS for E.C. Program four Information Construction: You might be required to make use of a dynamic 2D array (array of arrays) or a vector of vectors. Declare the construction BEFORE the loop, allocate and fill within the loop. Clear it out within the loop on the finish. Vectors are described on web page 557 of the Gaddis e book. 2D arrays are described at https://gsamaras.wordpress.com/code/dynamic-2nd-array-in-c/ When you do 2D arrays, the heading for the perform will seem like void readGraph(ifstream & infile, int ** & graph, int & measurement);
File I/O: Remark out the requests for filenames till your final run and earlier than you flip it in. Change the “filename” to infileName or outfileName as acceptable earlier than turning it in. void openFiles(ifstream & infile, ofstream & outfile)
Early exit loops: The perform that examine if a graph has an Euler Circuit has an outer loop with a Boolean flag that’s initialized to true. The perform that finds an Euler Circuit has a do-while loop for the outer loop (cease when the following vertex is similar as the unique vertex). There may be an interior whereas loop that stops while you discover an adjoining vertex. The perform that determines if the graph has any edges has two whereas loops that use a Boolean flag that’s initialized to true. Eradicating (slicing) and edge: Don’t overlook to take away each (u, v) and (v, u) for the reason that graphs are undirected.
https://gsamaras.wordpress.com/code/dynamic-2nd-array-in-c/