Write a method that will Remove the smallest of all the integers in a double linked list. The method should have a parameter of type Node and should return a value of type int.
java code
java code
Assignment #2: Q1. [25 pts] Write the following classes that implement a single Linked List of integers: 1) Class Node: It includes two instance variables: int number and Node next. It contains the following methods: 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 () 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 () that returns true if all nodes in the linked List have a one-digit value and false otherwise. o public void iterativeReverse () that reverses the original linked list iteratively. public void recursiveReverse () that calls the private method void recursiveReverse (Node head) 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 method recursiveReverse() and then call method print() Call method iterativeReverse() and then call method print() Q1. [25 pts) Write the following classes that implement a single Linked List of integers: 1) Class Node: It includes two instance variables: int number and Node next. It contains the following methods: 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 () 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 () that returns true if all nodes in the linked List have a one-digit value and false otherwise. public void iterativeReverse () that reverses the original linked list iteratively. o public void recursiveReverse () that calls the private method void recursiveReverse(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 method recursiveReverse() and then call method print() Call method iterativeReverse() and then call method print()