Professional Documents
Culture Documents
CSCI 2122 Assignment 3
CSCI 2122 Assignment 3
Objectives
The purpose of this assignment is to practice your coding in C, focusing on linked list manipulation and
encapsulation as well as using the module that you create.
This assignment is divided into two problems. In the first problem, you will extend a linked list implemen-
tation by adding an overlap() and a splice() functions, allowing the merging of two lists into one.
In the second problem you will use the list implementation to solve a problem.
Preparation:
1. Complete Assignment 0 or ensure that the tools you would need to complete it are installed.
2. Clone your assignment repository:
https://git.cs.dal.ca/courses/2024-winter/csci-2122/assignment-3/????.git
where ???? is your CSID. Please see instructions in Assignment 0 and the tutorials on Brightspace if
you are not sure how.
Inside the repository there are two directories: linkedlist and splicer, where code is to be written.
You should set up a separate CLion project for each of these directories, like the labs. Inside each directory
is a tests directory that contains tests that will be executed each time you submit your code. Please do
not modify the tests directory or the .gitlab-ci.yml file that is found in the root directory. Mod-
ifying these files may break the tests. These files will be replaced with originals when the assignments are
graded. You are provided with sample Makefile files that can be used to build your program. If you
are using CLion, a Makefile will be generated from the CMakeLists.txt file generated by CLion.
int main() {
…
int result = do_operation(13, 24, &add);
…
}
Example
Input Output
2 List 0: new list
list 0 new [ ] (0 items)
list 1 new List 1: new list
list 0 build 5 ali ben gem dan eve [ ] (0 items)
list 1 build 5 gem dan eve ali ben List 0: build
list 0 overlap 1 [ ali ben gem dan eve ] (5 items)
list 0 splice 1 List 1: build
list 1 print [ gem dan eve ali ben ] (5 items)
end List 0: Overlap between lists 0 and 1 is 3
List 0: List 1 spliced to the end of list 0
[ ali ben gem dan eve ali ben ] (7 items)
List 1: print
[ gem dan eve ] (3 items)
Example
Input Output
Lorem ipsum dolor sit amet, consectetur Lorem ipsum dolor sit amet, consectetur
adipiscing elit. EOS adipiscing elit. Pellentesque sed
Pellentesque sed dolor non arcu imperdiet dolor non arcu imperdiet placerat.
placerat. EOS
dolor sit amet, consectetur adipiscing
elit. Pellentesque sed dolor non EOS
EOS
Assignment Submission
Submission and testing are done using Git, Gitlab, and Gitlab CI/CD. You can submit as many times as you
wish, up to the deadline. Every time a submission occurs, functional tests are executed, and you can view
the results of the tests. To submit use the same procedure as Assignment 0.
Grading
If your program does not compile, it is considered non-functional and of extremely poor quality, mean-
ing you will receive 0 for the solution.
Quality of Solution: “Is it a good solution?” This considers whether the approach and algorithm in your
solution is correct. This is determined by visual inspection of the code. It is possible to get a good grade
on this part even if you have bugs that cause your code to fail some of the tests.
Code Clarity: “Is it well written?” This considers whether the solution is properly formatted, well docu-
mented, and follows coding style guidelines. A single overall mark will be assigned for clarity. Please see
the Style Guide in the Assignment section of the course in Brightspace.