Question: Modify the LinkedList class given to implement a reverse method(). This method should modify a LinkedList by reversing it. EXAMPLE: 3-4-1-10 should be modified

Modify the LinkedList class given to implement a reverse method(). This method

 should modify a LinkedList by reversing it. EXAMPLE: 3-4-1-10 should be modified to be 10-1-4-3 In a class with a main() method test this reverse method and display the results on lists of size 0, 1, 5 different numbers and 10 different numbers.

Modify the LinkedList class given to implement a reverse method(). This method should modify a LinkedList by reversing it. EXAMPLE: 3-4-1-10 should be modified to be 10-1-4-3 In a class with a main() method test this reverse method and display the results on lists of size 0, 1, 5 different numbers and 10 different numbers.

Step by Step Solution

3.32 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

LinkedListjava public class LinkedList private Node head private Node tail public LinkedList head nu... View full answer

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 Programming Questions!