Question: 4 . 1 . Add a method that findthird ( ) that finds the third node of a doubly linked list by link hopping. You

4.1. Add a method that findthird() that finds the third node of a doubly linked list by link hopping.
You can assume the list has at least three items.
Your findthird() code will be located in DoublyLinkedList.java
Starter code for the findthird() method:
// Janet McGregor 4/20/2053
public E findithivod()(
Node E > chrtentiode = headernext;
// the rest of your code goes here
return curfentNoderielement;
}
4.2. Test findthird() with the following three tests cases. You are welcome to add more, but you must include these.
Sample program output:
Finding the third value of this list:
(1,2,3,4)
The third value is: 3
Finding the third value of this list:
(1,2,3,4,5,6,7)
The third value is: 3
Finding the third value of this list:
("Apple", "Banana", "Coconut")
The third value is: Coconut
Your code must work for any doubly-linked list with enough entries, not just the examples.
 4.1. Add a method that findthird() that finds the third node

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!