From d299c786e336444ccdbc8ac730b776fa1c9fb7b9 Mon Sep 17 00:00:00 2001 From: Mohit Singh Date: Tue, 29 Jan 2019 22:48:03 +0530 Subject: [PATCH] Merge Sort Program with Complexity Analysis --- Merge Sort/MergeSort.c | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Merge Sort/MergeSort.c diff --git a/Merge Sort/MergeSort.c b/Merge Sort/MergeSort.c new file mode 100644 index 0000000..0d19c38 --- /dev/null +++ b/Merge Sort/MergeSort.c @@ -0,0 +1,77 @@ +#include +#include +int count; +void mergesort(int[], int, int); +void merge(int[], int, int, int); +int main() +{ + int a[1200],b[1200],c[1200],c1,c2,c3,i,j,n; + printf("Enter the number of elements: "); + scanf("%d",&n); + printf("Enter the elements: "); + for(i = 0; i < n; i++) + scanf("%d",&a[i]); + mergesort(a,0,n-1); + printf("Sorted Array:"); + for(i=0;i