Question: File supplied.o contains code that can build, display, and destroy a doubly linked list . For this lab, you will need to write the following

File supplied.o contains code that can build, display, and destroy a doubly linked 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.

void duplicate(node * head, node *& newHead)

recursively create a copy of the source list with head where newhead is the head of the destination list.

int removeTwo(node *& head)

recursively remove all the 2s from the 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!