Comp 121 Introduction to Data Structures.
Fall 2000
Programming Assignment 5 -- Due December 7th, 2000
This programming assignment requires you to efficientlydo the following:
- Read in a directed graph from an input file, specified in the format given below. The name of the input file will be provided as a command-line argument.
- Sort the vertices of this graph in an array the (integer) location of a vertex in this sorted array is to be the internal name of this vertex.
- Represent the graph as an adjacency matrix.
- Determine whether this graph is cyclic or acyclic if acyclic, print (on
stdout) the vertices of the graph in a topological order.
Input file format. An input file will be provided on the course web-page prior to the submission deadline. This file will be in the following format. The keyword
vertices is followed by an integer denoting the number of vertices, and a list of names of the individual vertices, and is terminated by the keyword edges. Each edge is specified by an ordered pair denoting the two vertices connected by the edge. For example,
Submission. The following rules will be strictly enforced:
- Do not submit programs that will not compile. Explicitly state, as part of your honor pledge, how close your program comes to achieving the goals.
- Failure to sign the pledge will result in no points being awarded.
- Submissions will not be accepted after 10 minutes have elapsed from the start of class no late submissions will be accepted without documented reasons.
You are not permitted to work in groups all your work must be your own, and you must attest to this in a signed pledge failure to do so results in your program not being graded.
- Include a complete listing of all your code, input files, and output files
- Your code must be
appropriately commented --- if we dont understand your code with reasonable effort, you get no credit for it.
Include a test plan detailing how you tested your program, and why you believe it is correct. (Note that the word-counting utility does not test your deletion routines these must be tested separately!!)
Include a (neatly typed not handwritten) design plan and some general comments on the structure and layout of your assignment.
All of the above should be placed in an envelope with your name on the outside, and submitted at the beginning of class on the due date. Submissions will not be accepted after 10 minutes have elapsed from the start of class no late submissions will be accepted without documented reasons.