Question: public class HeadTailList { private class Node { double item; Node next; } private Node head; private Node tail; private int size; public HeadTailList (
public class HeadTailList
private class Node
double item;
Node next;
private Node head;
private Node tail;
private int size;
public HeadTailList
head null;
tail null;
size ;
public HeadTailListdouble value
Constructor implementation needed
public boolean isEmpty
return size ;
public int length
return size;
Additional methods to be implemented...
public class HeadTailList
private class Node
double item;
Node next;
private Node head;
private Node tail;
private int size;
public HeadTailList
head null;
tail null;
size ;
public HeadTailListdouble value
Constructor implementation needed
public boolean isEmpty
return size ;
public int length
return size;
Additional methods to be implemented...
a points Implement the HeadTailList double value constructor.Testing your implementation
Please complete the above implementation and keep it as a file HeadTailList. java.
Please write a main method in another file to perform the following steps to test your
implementation.
points Read from the text file "doublevalues.txt to insert these values
into the head of the list and display all the elements of the list.
points Insert the value at the end of the list.
points Insert the value at the position of index
points Delete the last element of the list.
points Display all the elements of the list.jnl
b points Implement a method insertFront double value to add a new element at
the front of the list.
c points Implement a method insertEnd double value to add a new element at the
end of the list.
d points Implement a method insertAtPositiondouble value, int position to
insert a new element at a specified position in the list.
e points Implement a method removeEnd to delete the last element of the list.
f points Implement a method printList to display all items in the list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
