#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <deque>
using namespace std;
int main(void)
{
const int MAX_ELEMENTS = 8;
typedef vector<int> IntVector;
typedef IntVector::iterator IntVectorIt;
typedef list<int> IntList;
typedef IntList::iterator IntListIt;
typedef deque<int> IntDeque;
typedef IntDeque::iterator IntDequeIt;
IntVector NumbersVector(MAX_ELEMENTS);
IntVectorIt startv, endv, itv;
IntList NumbersList;
IntListIt first, last, itl;
IntDeque NumbersDeque(2 * MAX_ELEMENTS);
IntDequeIt itd;
NumbersVector[0] = 4;
NumbersVector[1] = 10;
NumbersVector[2] = 70;
NumbersVector[3] = 10;
NumbersVector[4] = 30;
NumbersVector[5] = 69;
NumbersVector[6] = 96;
NumbersVector[7] = 100;
first = NumbersList.begin();
last = NumbersList.end();
//place the results in NumbersDeque
merge(startv, endv, first, last, NumbersDeque.begin());
for (itd = NumbersDeque.begin(); itd != NumbersDeque.end(); itd++)
cout << *itd << " ";
}
|