diff --git a/Merge Sorting using Devide and Conquer b/Merge Sorting using Devide and Conquer new file mode 100644 index 0000000..8f487d3 --- /dev/null +++ b/Merge Sorting using Devide and Conquer @@ -0,0 +1,87 @@ +#include +using namespace std; +int Merge(int A[],int p, int q,int r) +{ + + int n1,n2,i,j,k; + //size of left array=n1 + //size of right array=n2 + n1=q-p+1; + n2=r-q; + int L[n1],R[n2]; + //initializing the value of Left part to L[] + for(i=0;i>n; + int A[n],i; + cout<<"Enter array values:\n"; + for(i=0;i>A[i]; + //Calling the MergeSort() + //First we are passing the array + //the start index that is 0 + //and the size of the array n + + MergeSort(A,0,n-1); + cout<<"The Sorted List is\n"; + for(i=0;i