Question;In this assignment you need to extend the Linked List.java file to include the methods: addList, subtrac tList, and reverseList:1. addList:This method is supposed to take another linked list as a parameter, and add the contents of this linked list to the calling instance's linked list. Adding the elements should only be done if the element does not already exist. All elements to be added should be added at the end of the linked list.2. subtractList:This method does the opposite of addList. It is to take another linked list as a parameter and remove the contents of this linked list from the calling instance's linked list. Elements are only removed if they exist.3. reverseList()No parameters passed, but it should reverse the contents of the list.What to do and what to submit?^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Start with the file LinkedList.java and add these methods to it. Upon adding these methods to the file, you must uncomment the sections in ListDriver.java to test to see if it will run and produce the required results.- Your code in LinkedList.java MUST work with the ListDriver.java file with removing the comments being the only modification.- We are going to change this file to test your code, however, the changes that we are going to make will only be relating to the contents of the lists l, and l2. Therefore, you should not restrict your testing of your three methods to the lists constructed in the file ListDriver.java. You should try to test your code with different contents of these two lists.
Paper#36582 | Written in 18-Jul-2015Price : $34