-
What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool myfunction (int k,int L)
{
return (k}
int main ()
{
int num[] = {10, 11, 15, 13, 25};
vector<int> VectorData (num, num + 5);
partial_sort (VectorData.begin(), VectorData.begin() + 3, VectorData.end());
partial_sort (VectorData.begin(), VectorData.begin() + 2, VectorData.end(),
myfunction);
for (vector<int> :: iterator Iter = VectorData.begin(); Iter != VectorData.end(); ++Iter)
{
cout << ' ' << *Iter;
}
return 0;
}
-
- 10
- 10 11
- 10 11 13
- 10 11 13 15
- 10 11 13 15 25
Correct Option: E
In this program, We are partitioning the value by using the partial_sort method.