i made the following merge sort program but it is not working at all. it just displays the original array. pl help
#include <iostream>
using namespace std;
void sort(int *,int *,int *);
void merge(int *);
int main()
{
int n;
cout<<"enter the number of elements \n";
cin>>n;
int * arr;
arr=new int[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
merge(arr);
for(int i=0;i<n;i++)
{
cout<<arr[i]<<" ";
}
}
void sort(int *arr,int *l,int *r)
{
int ls,rs;
ls=sizeof(l)/sizeof(l[0]);
rs=sizeof(r)/sizeof(r[0]);
int i,j,k;
i=j=k=0;
while(i<ls && j<rs)
{
if(l[i]<r[j])
{
arr[k]=l[i];
i++;
}
else
{
arr[k]=r[j];
j++;
}
k++;
}
while(i<ls)
{
arr[k]=l[i];
i++;
k++;
}
while(j<rs)
{
arr[k]=r[j];
j++;
k++;
}
}
void merge(int * arr)
{
int n;
n=sizeof(arr)/sizeof(arr[0]);
if(n<2)
{
return;
}
int mid;
mid=n/2;
int l[mid],r[n-mid];
for(int i=0;i<mid;i++)
{
l[i]=arr[i];
}
for(int i=mid;i<n;i++)
{
r[i]=arr[i];
}
merge(l);
merge(r);
sort(arr,l,r);
}