Various versions of the solution will be posted here.
The versions represent different stages in the development of the solution.
Paying attention to this sequence of versions will give you insights into
how a fairly large programming project can be broken up into pieces and
how each piece might be developed and tested.
Most of the work was in getting Version 1 done. After that it was a matter of
making small increments to the code to obtain each subsequent version.
- Version 1: (posted 10/20) This version supports the += operator for inserting
nodes and edges into a graph, along with the get_neighbors function.
The delete operations are not supported,
none of the classes are templated, and there is no error checking of any
sort.
This was compiled using the command:
g++ -o driver1 apstring.cxx node1.cxx edge1.cxx graph1.cxx driver1.cxx
node1.h,
node1.cxx,
edge1.h,
edge1.cxx,
graph1.h,
graph1.cxx,
driver1.cxx,
input1.1, and
input1.2.
- Version 2: (posted 10/24) This version was obtained by adding to
the graph class in version 1, support for the -= operator for
deleting nodes and edges into a graph.
None of the classes are templated, and there is no error checking of any
sort.
Also, there is no resizing yet, in the function that deletes nodes.
I am providing the entire set of the files again, but the only files
that have changed since Version 1 are graph.h, graph.cxx,
and driver.cxx.
I am also providing output files corresponding to the given input files.
You can use these to check the output produced by your programs.
node2.h,
node2.cxx,
edge2.h,
edge2.cxx,
graph2.h,
graph2.cxx,
driver2.cxx,
input2.1,
input2.2,
output2.1, and
output2.2.
- Version 3: (posted 10/25) This version was obtained by adding error
checking to version 2.
In addition, resizing if necessary, has been added to the node deletion
function.
The only file that has changed from version 2 is graph.cxx.
However, I am providing the entire set of the files again.
I am also providing a couple of input files that test all of the error checking
required of the progrem.
The corresponding output files are also provided.
node3.h,
node3.cxx,
edge3.h,
edge3.cxx,
graph3.h,
graph3.cxx,
driver3.cxx,
input3.1,
input3.2,
output3.1, and
output3.2.