Question: I need the second output public static void main(String[] args) { / Start with the empty list */ Main program to DLL dII = new

public static void main(String[] args) \{ / Start with the empty list */ Main program to DLL dII = new DLL(); test above functions // Insert 6. So linked list becomes 6->NULL dil.append(6); // Insert 7 at the beginning. So linked list becomes 7>6> NULL dil.push(7); Output: // Insert 1 at the beginning. So linked list becomes 1>7>6> NULL Created DLL is: Traversal in forward directio dil.push(1); 17864 // Insert 4 at the end. So linked list becomes 176>4> NULL dill.append(4); // Insert 8, after 7. So linked list becomes 1>7>8>6>4> NULL. dil.InsertAfter(dil.head.next, 8); System.out.println("Created DLL is: "); dil.printlist(dII.head); \} Traversal in reverse direction 46871 Faculty of Computer Science and information TechnolosyAlBaha Univenity Course: Data Structures and Algorithms Doubly Linked List: Write a method body (name the method printReverse) that prints the elements in the list in a reverse order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
