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.
Step by Step Solution
3.32 Rating (149 Votes )
There are 3 Steps involved in it
LinkedListjava public class LinkedList private Node head private Node tail public LinkedList head nu... View full answer
Get step-by-step solutions from verified subject matter experts
