C++ recursive merge-sort
\nclass Solution {\npublic:\n    vector<int> mergeSorted(vector<int>& a, vector<int>& b)\n    {\n        vector<int> res;\n        int i=0, j=0;\n        while 
```\nclass Solution {\npublic:\n    vector<int> mergeSorted(vector<int>& a, vector<int>& b)\n    {\n        vector<int> res;\n        int i=0, j=0;\n        while (i<a.size() && j<b.size())\n        {\n            if (a[i] < b[j])\n            {\n                res.push_back(a[i]);\n                i++;\n            }\n            else\n            {\n                res.push_back(b[j]);\n                j++;\n            }\n        }\n        while (i < a.size())\n        {\n            res.push_back(a[i]);\n            i++;\n        }\n        while (j < b.size())\n        {\n            res.push_back(b[j]);\n            j++;\n        }\n        return res;\n    }\n    vector<int> sortArray(vector<int>& nums) {\n        if (nums.size() <= 1)\n            return nums;\n        auto start = nums.begin();\n        auto mid = nums.begin() + nums.size()/2;\n        auto end = nums.end();\n        vector<int> v1(start, mid);\n        vector<int> v2(mid, end);\n        vector<int> left = sortArray(v1);\n        vector<int> right = sortArray(v2);\n        return mergeSorted(left, right);\n    }\n};\n```
[]