CS 112
Homework 10
This is part 1 of your final project. Part 2 will be handed in
next week. This "homework" will not be graded as a separate
homework, but rather as part of your final project (worth 20% of
your final grade).
You should strive to finish it, as usually, by the Wednesday night
deadline. Submit whatever you have done by the deadline in the directory
Hw10. I accept, without penalty, programs with a fundamentally
correct design but which perhaps are not fully debugged. However, if
you have not started working on this assignement, have not
submitted anything or have submitted a file that has nothing to
do with the assignment, your final grade on the project will be affected.
Adjacency list representation of a (di)graph
Design, implement and test a class called Graph which implements
an
abstract data type for a
directed graph (as explained in class on Thursday).
The data structure should be implemented
as an array of linked lists and the class should
contain
functions to create an empty graph, to add a new node or a new edge,
to read a graph from the standard input (keyboard) in some standard format
(e.g. vertices followed by neighbors),
and to print it in a nice way.
You should re-use the linked list class that you have implemented
in a previous homework.
You should come up with the best
solution you can for this implementation.
Then you should discuss your solution with me in
next Tuesday's lab to check that it is sound, before embarking
(next week) on
the implementation of the final step of the project.
The second part of the project will be described in more detail
next week. For your information, it will ask you
to add to the Graph class a function to traverse
the graph in Depth-First Search order and a few other methods.
The final program should be self contained, with a menu-driven
test driver which asks the
user for options (create a graph, add new nodes, edges, print, traverse, etc.),
and a typescript with a comprehensive set of test cases.
There will be several levels of complexity for the final project,
ranging from a minimum version (needed to get a passing grade on
the project) to more elaborate versions, culminating to the
"exceptional" version, for those aiming at the top grade. To give
you a sense of the direction, the
highest version will imply working with templates for defining a
general Graph class template.
I will NOT give detailed instructions for you on what to
implement, what files
to submit, or how to test the final project. Rather, I assume
that now, at the end of the semester, you know all the software
engineering principles I have taught you throughout the semester,
and that you
will apply them. The final project will be graded accordingly.
Ileana Streinu