Question: Your task is to create a doubly linked list and test its functionality. A doubly linked list has an additional pointer known as the previous
Your task is to create a "doubly linked list" and test its functionality. A doubly linked list has an additional pointer known as the previous pointer in its node, apart from the data part and the next pointer as in a singly linked list see figure below You have been provided a template that implements a singly linked list and the code for the data structure that represents a doubly linked list.
You must produce output in the precise form shown in the "Example Interaction" below, and must update the following methods in class List in order for them to handle a doubly linked list:
a public void insertAtFront E insert Item that inserts a given integer at the front of the list.
b public void insertAtBack E insertItem that inserts a given integer at the back of the list.
c public void print that prints in reverse order all the elements in the list starting at the last position. The method prints the string Empty list if there are no elements in the list.
Example Interaction:
The list in reverse order is:
The list in reverse order is:
The list in reverse order is:
The list in reverse order is:
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
