Trier les 5 premiers éléments d’une collection en ordre décroissant avec l’algorithme ‘partial_sort()’ et la fonction ‘greater()’

Author:

 deque, iterator
{filelink=15211}


#include 
#include 
#include 
#include 
#include 
using namespace std;

template 
inline void inserer_elements (T& coll, int first, int last)
{
    for (int i=first; i<=last; ++i) {
        coll.insert(coll.end(),i);
    }
}

int main()
{
    deque deq;
    ostream_iterator output(cout," ");
    inserer_elements(deq,12,18);
    inserer_elements(deq, 8, 21);

	cout<<"Le contenu du deque: ";
    copy(deq.begin(), deq.end(), output);
    cout<());

	cout<<"Le contenu du deque trié partiellement: ";
    copy(deq.begin(), deq.end(), output);
    cout<
    

Leave a Reply

Your email address will not be published. Required fields are marked *