Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "\n size:" << left.size() << " " << right.size() << endl;
- while (left.size()>0 && right.size()>0) {
- cout << " left.front():" << left.front() << " right.front():" << right.front() << endl;
- if (left.begin() <= right.begin()) {
- res.push_back(left.front());
- left.erase(left.begin());
- cout << " push_left size:" << left.size() << endl;
- }
- else {
- res.push_back(right.front());
- right.erase(right.begin());
- cout << " push_right size:" << right.size() << endl;
- }
- }
- if (left.size() > 0) {
- res.insert(res.end(), left.begin(), left.end());
- cout << " push_left_back " << endl;
- }
- if (right.size() > 0) {
- res.insert(res.end(), right.begin(), right.end());
- cout << " push_right_back " << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement