Question: Q1. 125 pt) write the following classes that implement a single List of integers: List of integers: Linked 1) Class Node: It includes two instance

 Q1. 125 pt) write the following classes that implement a single
List of integers: List of integers: Linked 1) Class Node: It includes

Q1. 125 pt) write the following classes that implement a single List of integers: List of integers: Linked 1) Class Node: It includes two instance variables: int number and Node next. It contains the following methods: o A constructor that initializes the instance variable number. o Set and get method for each instance variable. 2) Class SingleLinkedList: It includes two instance variables: Node head and Node tail. It contains the following methods: o public void insert (int n) that creates and adds a Node at the end of the linked List. o public void print 0 that prints the values of all nodes in the linked list, separated by an arrow as shown in the sample output. o public boolean oneDigit 0 that returns true if all nodes in the linked List have a one-digit value and false otherwise. o public void iterativeReverse 0 that reverses the original linked list iteratively o public void recursiveReverse 0 that calls the private method void recursive Reverse(Node head) o private void recursiveReverse (Node current) that reverses the original linked list recursively 3) Class TestSingleLinkedList. In the main method, do the following: Create an object of class SingleLinkedList. Read integer values from the user. The user must enter -1 to stop. Call method print() Call method oneDigit) and print a proper message based on the returning value. Call and then call method print() Call method iterativeReverse() and then call method print()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!