C++ || Easy Merge Sort
\n    \n    void merge(vector& nums, int l, int m, int r)\n    {\n        int n1 = m - l + 1;\n        int n2 = r - m;\n        int A[n1], B[n2];\n        \n   
\n    \n    void merge(vector<int>& nums, int l, int m, int r)\n    {\n        int n1 = m - l + 1;\n        int n2 = r - m;\n        int A[n1], B[n2];\n        \n        for(int i = 0; i < n1; i++)\n            A[i] = nums[l + i];\n        \n        for(int i = 0; i < n2; i++)\n            B[i] = nums[m + 1 + i];\n        \n        int i = 0, j = 0;\n        int k = l;\n        \n        while(i < n1 && j < n2)\n        {\n            if(A[i] <= B[j])\n                nums[k++] = A[i++];\n            else\n                nums[k++] = B[j++];\n        }\n        \n        while(i < n1)\n            nums[k++] = A[i++];\n        while(j < n2)\n            nums[k++] = B[j++];\n    }\n    \n    void mergeSort(vector<int>& nums, int l, int r)\n    {\n        if(l >= r)  //remember to put the equal to sign\n            return;\n        \n        int m = l + (r - l)/2;\n        mergeSort(nums, l, m);\n        mergeSort(nums, m + 1, r);\n        merge(nums, l, m, r);\n    }\n    \n    vector<int> sortArray(vector<int>& nums) \n    {\n        mergeSort(nums, 0, nums.size() - 1);\n        return nums;\n    }  \n    \n
['C', 'Merge Sort', 'C++']