V.push_back(27);
V.push_back(37);
V.push_back(17);
// convert V into a heap
make_heap(V.begin(), V.end(), less<int>());
/* greater <int> is a predicate function which creates a min heap Similarly to create a max heap less<int>() function can be used this is included in the functional header file */
cout<<"After calling make_heap function elements of V are:\n"<<endl;
for(il = V.begin(); il!=V.end(); il++)
cout<<*il<< " ";
cout <<endl<<endl;
// Sort the heapified sequence V
sort_heap(V.begin(), V.end());
cout<<"After calling sort_heap function V is as follows: " <<endl;
for(il = V.begin(); il! = V.end(); il++)
cout<<*il<< " ";
cout<<endl<<endl;
}