Question: In this assignment, you are required to implement a HeadTailList class to manage a linked list of double values. You need to use the following

In this assignment, you are required to implement a HeadTailList class to manage a
linked list of double values. You need to use the following template.
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 =0;
public HeadTailList(double value)
{
// Constructor implementation needed
}
public boolean isEmpty(){
}
return size ==0;
public int length(){
}
return size;
}
// Additional methods to be implemented...
a)(10 points) Implement the HeadTailList (double value) constructor.
b)(10 points) Implement a method insertFront (double value) to add a new element at
the front of the list.
c)(10 points) Implement a method insertEnd (double value) to add a new element at the
end of the list.
d)(20 points) Implement a method insertAtPosition(double value, int position) to
insert a new element at a specified position in the list.
e)(10 points) Implement a method removeEnd () to delete the last element of the list.
f)(10 points) Implement a method printList () to display all items in the list.
 In this assignment, you are required to implement a HeadTailList class

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!