USE C++ PART 1 1.Copy constructorto create a new bag using a bag passed in. However, please
Question:
PART 1
1.Copy constructorto create a new bag using a bag passed in. However, please note that the order in which this constructor stores the items is the reverse of the original order (in which the items appear in the passed-in bag). 2. FunctionaddVector, which takes a vector as the only parameter, to add the entries from the vector to the new bag. 3. FunctionremoveLastThree, which takes an item as the only parameter, to remove the last three occurrences of the item in the bag. It is OK to make assumptions. Please state our assumptions, if any.
Please explain in detailhow each step works and whatthe new bag contains after each of the steps is executed. - Please use linked Nodes diagrams in our answer. - Please use the data below in our explanation.
1. Passed-in bag: e, l, e, c, t, r, i, c, a, l 2. Passed-in vector: e, n, g, i, n, e, e, r
3. Passed-in item: e
Copy constructor(reverse order)
functionaddVector
functionremoveLastThree