Question: For this problem, you have a doubly linked list, implemented in the regular way, with two insert methods given below. public void insert1 (char

For this problem, you have a doubly linked list, implemented in the

 

For this problem, you have a doubly linked list, implemented in the regular way, with two insert methods given below. public void insert1 (char c){ Node nd = new Node(c); nd.setNext(head); if(head != null) head.setPrev(nd); else tail = nd; head = nd; } public void insert2(char c){ Node nd new Node(c); nd.setPrev(tail); if(tail != null) } else tail = nd; tail.setNext(nd); head = nd; Starting from an empty doubly linked list (myDLL), you insert chars into myDLL using the insert methods provided below. Draw your doubly linked list after all the inserts below have been performed. myDLL.insert2('k'); myDLL.insert1('e'); myDLL.insert2('e'); myDLL.insert('c'); myDLL.insert2('z'); myDLL.insert2('a');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!