Question: ) Singly-linked list: A simple list is implemented with node structure: struct node { int data; node *next; node(); }; node *L; If L is

) Singly-linked list: A simple list is implemented with node structure: struct node { int data; node *next; node(); }; node *L; If L is a pointer to the first item on a list, then the following is a recursive function for printing the list in reverse order: void rev(node *L) { if (L == NULL) return; rev(L->next); cout << L->data; return; } Modify this function to write another recursive function (you must use recursion, such as the one above): node *copy(node *L) { } to create a new duplicate copy of the original list and return a pointer to the new list.

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!