Question: In the main function, you are given a list, L, and another list, P, containing integers sorted in ascending order. The operation printLots(L,P) will print
In the main function, you are given a list, L, and another list, P, containing integers sorted in ascending order. The operation printLots(L,P) will print the elements in L that are in positions specified by P. For instance, if P = 1, 3, 4, 6, the elements in positions 1, 3, 4, and 6 in L are printed. In this case, for L=10,9,8,7,6,5,4,3, positions 1, 3, 4, and 6 in L are 9, 7, 6, 4. Write the procedure printLots(L,P). You may use only the public STL container operations. What is the running time of your procedure?
#include using namespace std;
template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
