From 58c39839f1ee41667c3c26eba0b6287a527c50c2 Mon Sep 17 00:00:00 2001 From: ankurgupta255 <43845288+ankurgupta255@users.noreply.github.com> Date: Sun, 28 Oct 2018 17:45:54 +0530 Subject: [PATCH] Merge Sort This is the function in C++ to combine two Sorted Arrays in Ascending order into a single Ascending order Sorted Array --- MergeSort.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 MergeSort.cpp diff --git a/MergeSort.cpp b/MergeSort.cpp new file mode 100644 index 0000000..3a138e3 --- /dev/null +++ b/MergeSort.cpp @@ -0,0 +1,27 @@ +/*This is the code for the Merging Sort function of two Sorted Arrays sorted + in ascending oder toan array containing the elements of both the arrays in ascending order */ +void MergeSort(int a[100],int m,int b[100],int n){ //This is the function definition with parametes including the two arrays to be merged sort in ascending order + int c[200]; + int k; + for(int i=0;int j=0;i