For this assignment, you will need to implement a linked list that maintains its elements in sorted order. For example, inserting , , (in that order) into a regular linked list would look like this: However, if the list maintained a sorted order, it would look like this:
A
A
A C
A
C
A B C
A
C
B
Now if we traverse the list from head to tail, we always get a sorted list.
1 Marking Guidelines
This assignment will count 8% towards your final mark for the course. It has two components: Component Weighting Requirements Automatic Testing 80% Pass all tests on PASTA 1. Commenting: Clear, sufficient comments (not excessive or with TODOs) 2. Layout: Consistent indentation that is easy to read Hand‐Marking 20% 3. Naming: Informative (and not too long) variable names 4. Efficiency: No unnecessary tasks performed For examples of well‐written code, see the solutions to previous tutorials
2 What you need to submit
For this assignment, you must submit EIGHT (8) files through PASTA: 1. 2. 3. 4.
LinkedListNode.java (and LinkedListNodeTest.java), an implementation of the Node ADT SortedLinkedList.java (and SortedLinkedListTest.java), an implementation of the LinkedList ADT Racer.java (and RacerTest.java), which is stored in your linked list and explained below Scoreboard.java (and ScoreboardTest.java), which uses your linked list and is explained below
You are NOT allowed to use any 3rd‐party libraries for this assignment. All code must be your own work. NOTE: You should write your own set of JUnit tests in the test files to ensure your 4 classes are working. Part of the assignment will be automatically marked, and you will only be allowed THREE (3) attempts in total. Each required file is covered in more detail below. A skeleton project has also been provided through eLearning.
2.1 Racer.java
Create a Racer class with the following structure: