Question: Create a function that combines two lists into one. For example, if list A consists of 1, 2, 3, 4 and list B consists of

Create a function that combines two lists into one. For example, if list A consists of 1, 2, 3, 4 and list B consists of 5, 6, 7, 8; after calling the function, list A should consists of 1, 2, 3, 4, 5, 6, 7, 8 and list B should contain nothing.

Use the following incomplete function definition.

void combine(Node* &head1, Node* &head2) { // . . . }

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!