Question
//**************************** DLLNode.java ******************************* // node of generic doubly linked list class public class DLLNode { public T info; public DLLNode next, prev; public DLLNode() {
//**************************** DLLNode.java ******************************* // node of generic doubly linked list class
public class DLLNode
//**************************** DLL.java ******************************* // generic doubly linked list class
public class DLL
public class DLLTest {
public static void main(String[] args) {
DLL
for(int i = 0; i
test.addToTail("a" + i);
test.printAll();
}
}
Question IID) Doubly linked lists (30 pts): Download, compile and execute the programs related to Doubly linked lists. (class DLL) Then add the following methods to the class DLL T.java: (a) public void printReverse () that prints the elements of list in reverse. (b)public void deletelth(i) which deletes the ith element from the list. Note that if you reach the end then you have to reverse the direction of counting. In the main0 method of the test class, create a randomly generated Doubly-Linked list of 10 Integers. Next, call the deletelth(7) method and print the lists iteratively until the list becomes empty. Make sure to print the list after each deletion For example, your list initially could be [3 125 879 0]. After deleting 7th element: [3 125872 0][3 125870] After deleting 7th element again; [3 125870]->[312587] After deleting 7th element again (counting in the same direction, then moving reverse), 3 12587]13 125 7] 3 1257315 7]
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