Question: using c++ Write a function that has two linked-list head pointers as parameters. Assume that the linked lists items are ordered by the < operator.

using c++ Write a function that has two linked-list head pointers as parameters. Assume that the linked lists items are ordered by the < operator. On each list, every item is less than the next item on the same list. The function should create a new linked list that contains all the items on both lists, and the new linked list should also be ordered (so that every item is less than the next item on the list). The new linked list should also eliminate duplicate items (i.e., if the same item appears on both input lists, then only one copy is placed in the newly con- structed linked list). To eliminate duplicate items, you may assume that two items can be compared for equality using ==. The function should return a head pointer for the newly constructed linked 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!