What will be the output of the following C++ code?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
vector <int> v = {1,5,23,90,15,35};
make_heap(v.begin(),v.end());
v.push_back(110);
push_heap(v.begin(), v.end());
pop_heap(v.begin(), v.end());
v.pop_back();
cout<<v.front();
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
vector <int> v = {1,5,23,90,15,35};
make_heap(v.begin(),v.end());
v.push_back(110);
push_heap(v.begin(), v.end());
pop_heap(v.begin(), v.end());
v.pop_back();
cout<<v.front();
}A. 90
B. 1
C. 110
D. 23
Answer: Option A

Join The Discussion