1.

What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int Array[] = {12, 1, 13, 51, 25};
vector<int> VectorData(Array, Array + 5);
make_heap (VectorData.begin(), VectorData.end());
pop_heap (VectorData.begin(), VectorData.end()); VectorData.pop_back();
VectorData.push_back(50); push_heap (VectorData.begin(), VectorData.end());
sort_heap (VectorData.begin(), VectorData.end());
for (unsigned k = 0; k < VectorData.size(); k++)
{
cout << ' ' << VectorData[k];
}
return 0;
}

A. 1 12 13 25 50
B. 1 12 13 25
C. 1 12 13
D. 1 12
E. 1
Answer» B. 1 12 13 25


Discussion

No Comment Found

Related MCQs