Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started