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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started