Question: c++ Doubly Linked List I need help implementing the following function. I can't view the prebuilt functions in list, but I need to write a

c++ Doubly Linked List

I need help implementing the following function. I can't view the prebuilt functions in list, but I need to write a recursive function that will duplicate the list. Can someone help me figure this out? Thank you!!!

c++ Doubly Linked List I need help implementing the following function. I

can't view the prebuilt functions in list, but I need to write

a recursive function that will duplicate the list. Can someone help me

File supplied.o contains code that can build, display, and destroy a doubly lineked list. For this lab, you will need to write the following two functions in dlist.cpp, and add function prototypes for them to dlist.h. Your solutions need to be recursive. void duplicate (node *& newHead) const recursively create a copy of the sburce list with head. newhead is the head of the destination list. #include #include #include #include using namespace std; struct node { int data; // some questions use a char * data; node * previous; node * next; }; class list { public: //These functions are already written list(); // supplied -list(); // supplied void build(); // supplied void display(); // supplied */ /* *** ***YOUR TURN! /* place your prototype here */ private: node * head; node * tail; /otice there is both a head //and a tail, common for DLL }; 1 #include "dlist.h" 2 3 using namespace std; 4 5 6 int main() 7 { 8 list object; 9 object.build(); 10 object.display(); 11 12 //PLEASE PUT YOUR CODE HERE to call the functions object.display(); return 0; 16 17 18 } 19

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 Databases Questions!