Question
Please have nice readable code and please upload to GitHub if you can also. ListDriver.java - https://gist.github.com/anonymous/293b06951f5a8bfe95a3a7d6f73e6c32 LinkedList.java - https://gist.github.com/anonymous/c7ca22ebee62dfa1cbb4f018e59508d1 In this assignment you are
Please have nice readable code and please upload to GitHub if you can also.
ListDriver.java - https://gist.github.com/anonymous/293b06951f5a8bfe95a3a7d6f73e6c32
LinkedList.java - https://gist.github.com/anonymous/c7ca22ebee62dfa1cbb4f018e59508d1
In this assignment you are required to extend the LinkedList.java file to include the methods: addList, subtractList, 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. A new version of ListDriver.java file has been uploaded as on the files from the 09/19/2016 lecture.
************* IMPORTANT NOTE: Your code in LinkedList.java MUST work with the ListDriver.java file with removing the comments being the only modification, basically remove only the // /* and */. No other edits are allowed in the ListDriver.java file.
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.
The only file that is to be submitted is LinkedList.java and no other file will be accepted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started