Question:
3.1 you are given a list, L, and another list P,containing integers sorted in ascending order, The operation Print(L,P) will print the elements in L that are in positions specified
by P. For instance, if P = 1,3,4,6, the element in positions 1,3,4 and 6 in L are printed. You may use only the public STL container operations.
What's the running time of your procedure?
Code is as following:
#include <list>
#include <iostream>
#include <ctime>
#include <algorithm>
#include <iomanip>
typedef std::list<int> lisInt;
void Print(lisInt L, lisInt P);
const int LIMIT{ 100 };
int main()
{
/*Creat a random list*/
lisInt List1;
srand(time(0));
int i = 0;
while (i++ < LIMIT)
List1.push_back(rand() % 100);
List1.sort();
std::cout << "\nList1 after soring:\n";
for (auto x : List1)
std::cout << std::