Question: Modify the targetList using the splice function to move elements from the sourceList as indicated in the comment. / / lists list sourceList = {

Modify the targetList using the splice function to move elements from the sourceList as indicated in the comment.
//lists
list sourceList ={7,9,2};
// Use the splice function to move elements from sourceList to targetList
// so that the resulting targetList is {3,5,6,7,9,2}
cout << "Modified targetList: ";
for (int num : targetList){
cout << num <<"";
}
a.
targetList.splice(targetList.end(), sourceList);
b.
targetList.splice(targetList.begin(), sourceList);
c.
targetList.splice(targetList.begin(), sourceList, sourceList.begin());
d.
targetList.splice(targetList.end(), sourceList, sourceList.begin());

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