#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
using namespace std;
int main()
{
int a[]={5,1,9,4,6,2,0,3,8,7};
make_heap(a,a+10,less<int>());
cout<<"make_heap:";
copy(a,a+10,ostream_iterator<int>(cout," "));
cout<<endl;
int b[]={5,1,9,4,6,2,0,3,8,7};
vector<int> heap;
for(int i=0;i<10;i++)
{
heap.push_back(b[i]);
push_heap(heap.begin(),heap.end(),less<int>());
}
cout<<"push_heap:";
copy(heap.begin(),heap.end(),ostream_iterator<int>(cout," "));
//
// heap.push_back(b[8]);
// heap.push_back(b[9]);
//
// cout<<"push_heap:";
// for(int i=0;i<10;i++)
// cout<<heap[i]<<" ";
// cout<<endl;
//
// push_heap(heap.begin(),heap.end(),less<int>());
// for(int i=0;i<10;i++)
// cout<<heap[i]<<" ";
// cout<<endl;
//
// copy(heap.begin(),heap.end(),ostream_iterator<int>(cout," "));
}