Use Java programming to implement thefollowing:
Implement the following methods in the UnorderedList class formanaging a singly linked list that cannot containduplicates.
- Default constructor
Create an empty list i.e., head is null. - boolean insert(int data)
Insert the given data into the end of the list. Ifthe insertion is successful, the function returns true; otherwise,returns false. - boolean delete(int data)
Delete the node that contains the given data from the list. If thedeletion is successful, the function returns true; otherwise,returns false. - int find(int data)
Search and return the index to the node that contains the data.Note that the index starts from 0. If it is not found, return-1. - int count()
Count and return the number of nodes in the list - String toString()
Return the string representation of this List where all data in thelist are enclosed in square brackets [ ].
Then write the program that accepts a sequence of commands andprint out the number of successful insertions, the number ofsuccessful deletions, the number of successful searches (throughthe “find” command), the number of items remaining in the listafter executing all commands and the final contents of thelist.
There are 3 commands which are “insert”, “delete” and“find”.
Input
Line 1: The number of transactions mon the list, where 1  m 200.
Line 2 to m+1: A string command(“insert”, “delete”, “find”) followed by an integer n(separated by a space).
- • “insert” means insert n into the list
- • “delete” means delete n from the list
- • “find” means find n in the list
Output
Line 1: Display 4 integers (each number isseparated by a space) which are:
- the number of successful insertions,
- the number of successful deletions,
- the number of items found (from the command “find”), and
- the number of items remaining in the list
Line 2: The final contents of the list
Sample Input | Sample Output |
3 insert 1 delete 5 find 2 | 1 0 0 1 [ 1 ] |
8 find 10 insert 3 insert 2 insert 1 delete 4 delete 3 insert 1 find 2 | 3 1 1 2 [ 2 1 ] |