# Can anyone correct this code c++

i implement Algorithm merge sort by c++
but it not sorted Array input

#include
using namespace std;
void MERGE(int* A, int p, int q, int r) {
int n1 = q - p + 1;
int n2 = r - q;
int* L = new int[n1];
int * R=new int[n2];
for (int i = 0; i < n1 + 1; i++) {
L[i] = A[p + i - 1];
}
for (int j = 0; j < n2 + 1; j++) {
R[j] = A[p + j];
}
int l = 0, t = 0;
for (int k = p; k < r + 1; k++) {
if (L[l] <= R[t]) {
A[k] = L[l];
l++;
}
else if (A[k] == R[t])
t++;
}
}
void Merge_sort(int* A, int start, int end) {
if (start < end) {
int q = (start + end) / 2;
Merge_sort(A, start, q);
Merge_sort(A, q + 1, end);
MERGE(A, start, q, end);
}
}

int main() {
int A = { 9,6,3,7,8,1,4,2,8,7 };
int a = 0, o = 5, e = 10;
cout << “Array sort” << endl;

``````Merge_sort(A,0,10);
``````

for (int s = 0; s < e; s++) {
cout << A[s] << " ";
}
}

that is out put of code
-858993460 -858993460 -858993460 -858993460 3 1 1 1 1 7

General C++ questions are better asked on StackOverflow. Use `torch.sort` to sort PyTorch tensors.