Starting from:

$30

Lab 3 Solution

One of the most important data structures that will be used is a Linked List. It is important that we develop a VERY generic linked list that we can use during the course of the quarter.




Node Specifics




void pointer for data



next pointer



prev pointer



Declared in the header file named linkedList.h



LinkedList Specifics




Node pointer for head (Dummy Head)



int size



Declared in the header file named linkedList.h



NOTE: The List will NOT be circular



Specific Information




You will not use gets – use scanf, fscanf, fgets



For the specific functions I have provided documented .h files. The comments are Javadoc style. Look through the .h files. To view the documentation open the html folder and find index.html.



I have provided the menu functions and the file utils functions.



I have provided a Makefile you must use. If you want you can use eclipse or Clion. My makefile won’t work with either, so use them and then at the end run my makefile to ensure your code compiles.



I have provided .h files. You CANNOT change them in any fashion. If you need to add anything add it to linkedList/requiredIncludes.h



The purpose is to create a generic linked list with a void * and function pointers and the type should not matter. In our case the type is a book and type stock. Please examine the appropriate .h files to understand the structures.



You will create an output file that shows the run of the program using valgrind. This output file should show that no memory is being leaked.



I have provided unchangeable cscd340Lab3.c



What You Must Complete




You must create and complete the functions in linkedList.c (See linkedList.h)



You must create and complete the functions in listUtils.c (See listUtils.h)



From Lab1 You need
myInt/myInt.C
Note another method has been added
Ensure you clear the input buffer after reading from stream
You must create
movies/movie.c (see movie.h and actor.h)



A movie structure contains




array of actor structure o char * title



o int total – total number of actors




An actor structure contains




char * first o char * last



FILE SPECIFICATIONS FOR ./input/movies.txt




of Movies in the file Title



of actors
One actor per line (first space last)




TO TURN IN

A zip file, in Canvas, by the required due date containing:



all files required to compile and run your code



all input file(s) used to test your program program



all output file(s)



my Makefile



a test run named cscd340Lab3val.txt – testing all aspects including showing your code is leak free.



We should be able to download the zip and compile your code, and then run your code.




Name your zip, your last name first letter of your first name lab3.zip (Example: steinerslab3.zip)

More products