CSC 7000-002 Algorithms & Programming
Fall 1999, Mendel 115
Dr. David Matuszek
The idea of this assignment is to build an attribute-value list ADT (Abstract Data Type). The purpose of this assignment is to give you additional practice with recursion, and to teach you about ADTs and multifile C programs.
An attribute-value list (or A-V list) is a linked list of string
pairs, where one string is called the attribute and the other string is the value.
(If you want to put numeric values in an A-V list, just convert them to strings first.)
For example, an attribute might be "color" and its associated value might be
"red." We will require that every A-V list has an attribute name
with a non-NULL value--you should make sure this is always the first A-V pair in the list.
Implement the following operations on A-V lists:
name attribute.NULL. NULL, delete the attribute-value pair from
the list (and free() the storage used by the pair and the strings).name attribute will never be modified or deleted.Put your code in three files:
avlist.h contains any struct declarations, function prototypes, and #define
statements that outside code might wish to access. It must not contain any
definitions (declarations that also reserve storage) or any executable code.avlist.c contains all the A-V list function definitions. It also needs a
line that says include "avlist.h" . It could (but probably
won't) contain additional struct definitions, function prototypes, and #define statements
that you do not want to make generally available to outside code. main() program, and also needs a line that says include "avlist.h"
. This main program will be a throwaway program used for testing your A-V functions.It is your responsibility to provide output that demonstrates all the features of your program and that can be easily graded.
You will be graded more strictly than in the past on (1) following directions, (2) good
style,(3) good comments, and (4) appropriate use of functions. In addition, your program
will be examined for any obvious memory leaks.