1) There were some
errors in the original version of assignment 3.
These have now been fixed. The errors were
a) In Figure 1
the edge (4,1) was missing. It has now been added.
The commands g.setEdge(4,1); and g.delEdge(4,1); were
added to the beginning of the example program in the assignmnet
b) In file graph.h
virtual bool sibling(int i, int j);
to virtual bool sibling(int i, int j)=0;
c) The original output for cout <<g.sibling(0,2);
the example program
was incorrect. It has now been fixed (to output 0)
2) Q. Can we change the file
by adding new public
or private members?
A. No. We will be compiling the code using our graph.h
(the one provided in the assignment description). So,
even if you added members to your own version of graph.h
it would not help since we would not compile the code with it.
3) Q. I
am having difficulty compiling graphm.cpp and graphl.cpp
together using the same driver file. What can I do?
A. When we compile the code we will use different drivers
to test the graphl and graphm classes so this problem will not
occur during our testing (but it would still be good if you can
4) Q. Do we have to write constructors for graphm
A. You need to write constructors for graphm and graphl to
replace the ABS graph constructor. That is, the constructors should
have the prototypes:
graphm (int v); // Create a graph with v vertices
graphl (int v); //Create a graph with v vertices
We do not require that you write explicit destructors.
are not allowed to have memory leakage in your programs. So,
if your implementations use dynamically allocated memory, then
you must provide destructors that deallocate them.
5) Q. Can I use
instead of lists in
A. No. You must use some form of list in graphl, either
the STL provided list or one that you've written yourself.
The deque class does not provide fast insertion/deletion
from the middle of the container and would therefore be very
slow when updating large graphs.
6) Q. Can you provide a test driver for the programs?
A. HERE is a test driver (and its Output (revised May 18,2001) .
Please note that the driver only tests graphm. To test graphl
replace the fourth line in the driver -- #include "graphm.h" --
by #include "graphl.h"
7) Q. The original specifications for where to
place the program looked strange. Were they wrong?
A. Yes. there was a mistake in the original specifications. They have just been fixed and what is now written on the assignment specification page is correct. Your five files should actually be placed in directory ~/comp151/assign3