Description
For this request you must implement a list API that has been specified for you. You have been provided with a header file LinkedListAPI.h. You will need to create a file LinkedListAPI.c, which implements all of the functions specified in the header.
You cannot modify the header file and any way and all your functions must match the header exactly. Your request will be evaluated using an automated test suite, and deviations from the requirements specified in the header and the request description will result in severe penalties.
Note that while the list API is based on the one used in CIS*2520 this summer, that are a few differences. The biggest one is the addition of the iterator struct and related functions, but there are a few small changes here and there. Please read the header file carefully.
I have provided two sample main files that test the list API with two different types of contents. These must work with your list with absolutely no modifications. These files are meant as a guideline that will let you know whether you’re on the right track. They are not exhaustive test suites. You must test all of the functions provided by the list API yourself to make sure they match the requirements.
As mentioned in class, you are welcome to re-use your old list code from CIS2520. If you did not take CIS2520 with Judi McQuaig or Fangju Wang, make sure to contact your instructor to obtain their permission to use the code. In the header of the LinkedListAPI.c file state which course you are basing your list on.
A sample .c file with all the required submission headers and comments will be provided separately.
Compile your code with -Wall -std=c11 flags. Yes, we’ll be using C11 as the default C standard throughout the course. If you want to debug your code using gdb, remember to include the -g flag.
If you know how to use valgrind, make sure you find and fix all memory leaks. For this request, you will not lose marks for memory leaks, since we haven’t yet covered valgrind in class. However, starting with request 1, memory leaks will result in deductions.
Evaluation
Your code must compile, run, and have all of the specified functionality implemented. Any compiler errors will result in the automatic grade of zero (0) for the request.
Marks will be deducted for:
Incorrect and missing functionality
Deviations from the requirements
Run-time errors
Compiler warnings
Bad /inconsistent indentation
Bad variable names
Insufficient comments
Failure to follow submission instructions
To make it easier for you to test your code, I have provided two test files: StringListDemo.c and StructListDemo.c. Make sure that your list API complies and runs with both of them.
Make sure you compile and run your code in the lab or on the server. The course page will have a link to a Linux iso for VirtualBox that matches the SoCS Linux server. If the link isn’t up yet, it will be posted shortly.
Submission
Submit your LinkedListAPI.c file using Moodle. Additional submission guidelines will be added before the due date.
Late submissions: see course outline for late submission policies.