Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Kindly help fully. The Problem and Objectives Implementing an ordered list and demonstrate its use with an application. Requirements Create a folder A3YourName and add
Kindly help fully.
The Problem and Objectives Implementing an ordered list and demonstrate its use with an application. Requirements Create a folder A3YourName and add the folder to VS Code. Create a class DoublyLinkedList in the folder, copy and paste code into the file from zyDE 5.10.1: Doubly linked-list data structures and algorithms, then do the following: 1. The doubly linked list presented in zyDE 5.10.1 only supports int data type. Modify the class so that it can also be used to create linked lists of any reference data types, such as Integer, String, etc. HINT: 1) You need to change the Node and DoublyLinkedList to generic classes. 2) The comparison operators should be changed to compareTo() method. NOTE: if you find this task is difficult, proceed to other tasks. 2. Create an OrderedDLinkedList that extends the DoublyLinkedList. Other than the inherited components from the DoublyLinkedList class, the OrderedDLinkedList also has its own add() method. Implement this method so that it will add a data element to an OrderedDLinkedList and the data in the list will be kept in ascending order. NOTE: if you haven't completed the task 1 to convert the doubly linked list to a generic class, you may extend the original DoublyLinkedList class from the textbook for your OrderedDLinkedList for reduced marks. In that case, your OrderedDLinkedList will only be able to store int data values. You may also use the LinkedList from Java Library, which is a generic class, as the base to make your OrderedDLinkedList. 3. Create another class OrderedListApp in the same folder. In the main() method of this class do the following: a. Create an ordered list of Integers. Add 5 random integers to the list, then display the list content. b. Create an ordered list of String type. Add 5 unordered strings to the list, then display the list content. Here is a sample dialog: Values are added in this sequence: 14,2,20,31,16,55 Values in the ordered list: 2141623155 These values are removed from the list: 20,2,55 List after the values are removed: 141631 Names are added in this sequence: John, Bob, Tim, Rick, Adam. Names in the ordered list: Adam Bob John Rick Tim These names are removed from the list: Adam, Tim, John List after the names are removed: Bob Rick 4. Analyze the performance efficiency of the add() method and present your analysis result in Big-O notation for the best case, worst case, and average case. The analysis process / reasoning is expected. 5. Bonus (10\%) - In assignment 1 , you used an ArrayList in the EmployeeList class. Copy the Java and text files from assignment 1 folder to assignment 3 folder. Modify the EmployeeList class so that it uses the OrderedDLinkedList instead of the ArrayList in its implementation. Then test your solution. NOTE: a) You need to make the Employee object comparable, if they are not in your original design. b) Be prepared that much work might be neededStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started