The C code
For the array implementation:
For the linked list implementation:
The apptcal files are different, of course, because the implementation
is changed here from array to linked list.
The queue files implement the queue ADT, which you need to use
in this implementation's view-week code (as described in the handout).
About the C code
-
You will notice that appt.h (and other header files here are analogous)
defines the type used to implement an appointment.
This is contrary to the first way I've shown you to structure ADT code in C --
I showed you how you can hide such declarations in the .c file.
The problem with this is that you could then have only one instance of
appointment, which is certainly a problem.
In lectures during week 4, you will discuss the alternative used here,
which compromises somewhat on information-hiding
in order to permit multiple instances.
-
There isn't a great deal of error checking of the input
to the program. You do not have to improve this.
But you may find it annoying that the program will crash
if you make a typing mistake while running it.
Feel free to improve the error checking.
(There is no need to hand this in.)
Do not change anything else about our
code.