Question
If you remember, we have already completed a Linked List in class. For this assignment, create your own code. (Do not use the build in
If you remember, we have already completed a Linked List in class. For this assignment, create your own code. (Do not use the build in function or classes of Java or from the textbook). Create a LinkedList class: Call the class MyLinkedList, (hint) Create a second class called Node.java and use it, remember in the class I put the Node class inside the LinkedList Class, but you should do it outside. This class should have o Variables you may need for a Node, o (optional) Constructor Your linked list is of an int type. (you may do it as General type as ) For this Linked List you need to have the following methods: Write a main function or Main class to test all the methods, o Create a 2 linked list and test all your methods. (Including the compare)
public void add(int element)
public void addAfter(int element, int afterInt)
public void remove(int value)
public int size()
public boolean contains(int value)
public String toString()
public boolean compare(MyLinkedList otherList)
public void addInOrder (int element)
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