COMP 2503 Task 3 Fall 2021 This is a temporary work document to save and modify your responses. Once you have completed the questions and are ready to submit, copy and paste your responses into the...

files


COMP 2503 Task 3 Fall 2021 This is a temporary work document to save and modify your responses. Once you have completed the questions and are ready to submit, copy and paste your responses into the google form. Emailed submissions of this document will not be accepted. Reminder: Check the task rubric to see how you will be marked and hints at important things to include Total marks 27 Tasks are due on the date and time indicated. Any late tasks will lose 10% per day (including weekends) and no assignments will be accepted after 5 days late. Due: Friday October 29st, Weight: 10% (If you need an extension please email me.) Material this Task is based upon  02 Java - The old and the new  04. Linked Lists and Linked Structures Part 1 The basics  04.2 Linked Lists and Linked Structures Part 2 Mov Ref  4.3 Linked Lists and Linked Structures Part 3 Linked Lists Question 1 [2 mark] Sorting Students. The key goal for this task is to create and use a Comparator. This small coding task also demonstrates using some of the built in features of java to accomplish tasks. For this question you have been provided with a VERY small program that just lists out a specific number of students in a sorted order. The sorting is handled for you using the Collections.sort method. The program currently sorts based upon the Name or the ID of the students. Your task here is to modify the program so that it also sorts by the student’s age. Question 2 [3 mark] Conversion to a generic class. The goal for this question is to gain experience setting up a generic class and using a comparator. This task is similar to examples that have been shown in the “02 Java - The old and the new” lectures. You have been provided with a class called Node that you will have to turn into a generic class based upon the requirements that are given below. You will also have to update the NodeMain class to work properly. Requirements:  The Node class should accept one type parameter  That type parameter should be used for the data instance variable and for the type given to the ArrayList dataPoints (i.e Integer needs to be changed to the type parameter) Question 3 [22 mark] Link List - Coding question You will be completing methods for a generic Doubly linked list class. The skeleton of the class has been provided. Included with this class are J-unit tests that can be used to verify your solution. Your goal here is to properly implement each method and get them to pass the tests. Note: To properly get the code to run you will need to add the J-Unit library to your build path for the project. Implement all your code for this in the provided DLinkList class in the dList package. In the class you will find the methods marked with comments indicating which ones you must implement. You cannot break apart or change the given package structure The link list must have the following properties COMP 2503 Task 3 Fall 2021  The class will keep a reference to the start node in the list and the last/end node in the list  Each node has a next and previous link. o The next link in the node references the one after the current node. o The previous link will link to the node one step behind the current node in the list.  Try to implement each method to run as efficiently as you can. o Hint: create helper methods that can be used in multiple places where possible  As you implement each method you should run the Junit tests and verify that all the tests related to the method pass. In the end your class must pass ALL the Junit tests.  You cannot make any changes to the Junit code. End Start
Nov 26, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here