Question: In C++ Complete the program with the bold requirements #include #include #include using namespace std; int main () { list L1; list L2 (4,100); list
In C++ Complete the program with the bold requirements #include#include #include
using namespace std; int main () { list L1; list L2 (4,100); list L3 (L2.begin(),L2.end()); list L4 (L3); L1.push_back(12); L1.push_back(21); cout << "Content of L1 is "; for (list ::iterator it = L1.begin(); it != L1.end(); it++) cout << *it << ' '; cout << ' '; /* - insert 2 new elements in list L1, in front - print content of L1 */ L1.pop_back(); /* - print content of L1 */ /* - print list L2 - merge sort on L2 with L3, then with L4 (join the elements of L2 with L3, then with L4-sorted) - print list L2 */ int vInt[] = {16,2,77,29}; list L5 (vInt, vInt + sizeof(vInt) / sizeof(int) ); cout << "Content of L5 is "; for (list ::iterator it = L5.begin(); it != L5.end(); it++) cout << *it << ' '; cout << ' '; return 0; }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
