#include #include #include #include #include #include using namespace std; //myAlgo_inplace_merge1.cpp int main () { string str1[] = {"A", "C","B","D","E"}; string second[] = {"a", "c","b","d","e","f"}; vector v(11); vector::iterator it; ostream_iterator< string > output( cout, " " ); //before sort copy (str1,str1+5,v.begin()); copy (second,second+6,v.begin()+5); //ostream -iteration inplace_merge (v.begin(),v.begin()+5,v.end()); // cout<<"\n un-sorted inplace_merge \n\t"; copy( v.begin(), v.end(), output ); // sort (str1,str1+5); sort (second,second+6); copy (str1,str1+5,v.begin()); copy (second,second+6,v.begin()+5); // inplace_merge (v.begin(),v.begin()+5,v.end()); // cout<<"\n sorted inplace_merge \n\t"; copy( v.begin(), v.end(), output ); cout << endl; return 0; }