Question: The Lab Procedure: 1) The file doubleLinkedList.java must be distributed to the students in the lab to test and practice on the different double linked
The Lab Procedure:
1) The file doubleLinkedList.java must be distributed to the students in the lab to test and practice on the
different double linked operations; which was discussed in the lectures and described below.
public void push(int newdata) // This function inserts a new Node at front of the list
public void insertAfter(Node PrevNode, int newdata) // Insert a node after a given node
public void append(int newdata) // Add a new data to the end of the List
void insertBefore(Node NextNode, int newdata) // Insert a node before a given node
void deleteNode( Node del) // delete the node pointed by the parameter del
void printList() //This function prints contents of linked list starting from head
2) The students are required to write a main method containing the declarations to create an object of the class doubleLinkedList and call different functions to test their logics.
3) The students by themselves must write the body of the following methods:
- deleteNodeFirst that delete the first occurrence of a given integer from the double linked list.
- deleteNodeLast that delete the last occurrence of a given integer from the double linked list.
- [for clever students only] insertInOrder that adds an integer in its proper place in a sorted list of integers.
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
