Question: task 4 java lang 6:13 WO3 Lab Linked lists, Big O Notatio... Task 4. Comprehensive. (10 points) Modify the textbook's double-linked list class. Add a

task 4 java lang  task 4 java lang 6:13 WO3 Lab Linked lists, Big O
Notatio... Task 4. Comprehensive. (10 points) Modify the textbook's double-linked list class.

6:13 WO3 Lab Linked lists, Big O Notatio... Task 4. Comprehensive. (10 points) Modify the textbook's double-linked list class. Add a method findMiddle) that finds the middle node of a doubly linked list by link hopping without relying on explicit knowledge of the size of the list. Counting nodes is not the correct way to do this. In the case of an even number of nodes, report the node slightly left of center as the middle You can assume the list has at least one item. Your find Middle() code will be located in DoublyLinkedList.java. If you're using size), you're doing It wrong Starter code the findMiddle() method: // Janet McGregor 4/20/2053 public E findMiddle Node middle Node - header.next; Node currentNode=header.next; // the rest of your code goes here return middleNode.element; 3 You will test findMiddle() with the following three tests cases Sample program output: Finding the middle of the list: 1, 2, 3, 4, 5, 6, 7) The middle value is: Finding the middle of this list: (1. 2. 3. 4) The middle value Is: 2 Finding the middle of this list (First, Second, Third, Fourth, Fifth) The middle value is: Third Your code must work for any doubly-linked list, not just the examples. Rubrie: Student name and today's date are a comment on the first line of the program (-5 if fails) find Middle works without referencing the size property of the list: (-10 if fails) Program output shows the three sample test cases with different data types, regardless of whether findMiddle . Dashboard Calendar To-do Notifications 6:13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!