Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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 needed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago