Write an easier version of a linked list with only a couple of the normal linked list functions and the ability to generate and utilize a list of ints. The data type of the connection to the following node can be just Node, and the data element can be just an int. You will need a reference (Java) or either a reference or a pointer (C++) to the first node, as well as one to the last node. * Create a method or function that accepts an integer, constructs a node with that integer as its data value, and then includes the node to the end of the list. If the new node is the first one, this function will also need to update the reference to the first node. This function will need to update the reference to the final node. Consider how to insert the new node following the previous last node, and keep in mind that the next reference for the list's last node should be null. * Create a different method or function that iteratively explores the list, printing the int data values as it goes. It should start at the first node, follow the links to the final node, and so forth. * Write another function/method that takes an int parameter and determines whether that int is contained in the list. **Fianlly, to show that your list code is functional, create a main() method or JUnit tests. A list should be created, some nodes added, and then the list should be searched for a value that is *not* in the list and then for a value that *is* in the list. Additionally, make a list without any nodes and do a value search on it.**
(IntelliJ)
Write an easier version of a linked list with only a couple of the normal linked list functions and the ability to generate and utilize a list of ints. The data type of the connection to the following node can be just Node, and the data element can be just an int. You will need a reference (Java) or either a reference or a pointer (C++) to the first node, as well as one to the last node.
* Create a method or function that accepts an integer, constructs a node with that integer as its data value, and then includes the node to the end of the list. If the new node is the first one, this function will also need to update the reference to the first node. This function will need to update the reference to the final node. Consider how to insert the new node following the previous last node, and keep in mind that the next reference for the list's last node should be null.
* Create a different method or function that iteratively explores the list, printing the int data values as it goes. It should start at the first node, follow the links to the final node, and so forth.
* Write another function/method that takes an int parameter and determines whether that int is contained in the list.
**Fianlly, to show that your list code is functional, create a main() method or JUnit tests. A list should be created, some nodes added, and then the list should be searched for a value that is *not* in the list and then for a value that *is* in the list. Additionally, make a list without any nodes and do a value search on it.**
Step by step
Solved in 3 steps with 1 images