Consider the following implementation of double linked list class. public class DLIST { static class Node{ private E data, Node next, Node prev; private Node(E dataItem, Node nextnode, Node prevnode){...


Consider the following implementation of double linked list class.



public class DLIST {



static class Node{


private E data, Node next, Node prev;


private Node(E dataItem, Node nextnode, Node prevnode){     // constructor


 data = dataItem;


next = nextnode;


prev = prevnode


}


private Node(E dataItem) {                 //constructor


data = dataItem;


next = null; prev=null;


            }


    }



private Node head=null;


private Node tail=null;                  //initialisation


    }



a)      Write a Java method that prints 1st, 3rd, 5th, etc. nodes in the double linked list.



b)     Write a java method to display the double linked list in the reverse order.



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here