From 23f1ac1520dfcc9d2895b8608f17908491c87233 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sat, 20 Jun 2020 15:31:59 +0000 Subject: [PATCH] formatting source-code for b06bbf4dc6c46a3284d7852bb570438384eef4ef --- sorting/merge_sort.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sorting/merge_sort.cpp b/sorting/merge_sort.cpp index c28a28fe6..b3a6c678a 100644 --- a/sorting/merge_sort.cpp +++ b/sorting/merge_sort.cpp @@ -10,25 +10,25 @@ * Merge Sort is an efficient, general purpose, comparison * based sorting algorithm. * Merge Sort is a divide and conquer algorithm - * + * */ #include /** * - * The merge() function is used for merging two halves. - * The merge(arr, l, m, r) is key process that assumes that - * arr[l..m] and arr[m+1..r] are sorted and merges the two + * The merge() function is used for merging two halves. + * The merge(arr, l, m, r) is key process that assumes that + * arr[l..m] and arr[m+1..r] are sorted and merges the two * sorted sub-arrays into one. * * @param arr[] is the array with two halves one is arr[l...m] and * other is arr[m+1...l] * @param l is the left index of first half array * @param m is the end index of right index of first half array - * + * * (The second array starts form m+1 and goes till l) - * + * * @param l is the end index of right index of second half array */ void merge(int arr[], int l, int m, int r) { @@ -95,7 +95,7 @@ void mergeSort(int arr[], int l, int r) { * sorting */ void show(int arr[], int size) { - for (int i = 0; i < size; i++) std::cout << arr[i] << " "; + for (int i = 0; i < size; i++) std::cout << arr[i] << " "; std::cout << "\n"; } @@ -109,9 +109,9 @@ int main() { for (int i = 0; i < size; ++i) { std::cin >> arr[i]; } - mergeSort(arr, 0, size-1); + mergeSort(arr, 0, size - 1); std::cout << "Sorted array : "; - show(arr, size-1); + show(arr, size - 1); delete[] arr; return 0; }