Question: Fill an array with even numbers and a list with odd numbers. Use STL vector class member functions, or STL algorithms to merge these containers

Fill an array with even numbers and a list with odd numbers. Use STL vector class member functions, or

STL algorithms to merge these containers into a vector. Display the vector contents to show that all

went well. Note the vector should combine the numbers on the array and the list without change their

original order.

Now re-arrange the contents on the vector so that they are in ascending order. Display the vector

contents again.

There are many ways to get the above tasks done. Look for the best ways and make your code look

elegant. Repeatedly use the push_back function should be avoided.

To practice on STL syntax, dont use the array notation when display the vector contents.

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!