Merge sort Error
#include <iostream> using namespace std; const int max = 5; int arr[max]={1,3,6,2,0}; void merge(int low, int mid, int high); void merge_sort(int arr[], int low, int high); int main() { cout<<"Before sorted: \n"; for(int i = 0 ; i < max ; i++) { cout<<arr[i]<<" "; } merge_sort (0, max -1); cout <<"Sorted array: \n"; for (int i = 0 ;i< max; i++) { cout<<arr[i]<<" "; } return 0; } void merge_sort (int arr[], int low , int high ) { int mid; if(low < high ) { mid=(low + high)/2; merge_sort(arr,low, mid); merge_sort (arr,mid+1, high ); merge (arr,mid,high ); } } void merge (int arr[], int low, int high ) { int i = low; int j =mid +1; int k = low int temp[max]; while((i<=mid)&&(j<=high)) { if(arr[i]<=arr[j]) temp[k++]=arr[i++]; else temp[k++]=arr[j++]; } while(i<=mid) temp[k++]=arr[i++]; while(j<=high) temp[k++]=arr[j++]; for(i=