From 43506c268f55aff1a2711011db95915c7ce0faff Mon Sep 17 00:00:00 2001
From: jayakrishna78 <127725197+jayakrishna78@users.noreply.github.com>
Date: Wed, 6 Dec 2023 18:44:29 +0530
Subject: [PATCH 1/3] Create README.md
---
Sorting/Hard/MergeSort/README.md | 335 +++++++++++++++++++++++++++++++
1 file changed, 335 insertions(+)
create mode 100644 Sorting/Hard/MergeSort/README.md
diff --git a/Sorting/Hard/MergeSort/README.md b/Sorting/Hard/MergeSort/README.md
new file mode 100644
index 00000000..1f08f40c
--- /dev/null
+++ b/Sorting/Hard/MergeSort/README.md
@@ -0,0 +1,335 @@
+
MERGE SORT
+
+Merge sort is a popular sorting algorithm that follows the divide-and-conquer approach. It works by dividing the unsorted list into smaller sublists, sorting those sublists recursively, and then merging them back into a sorted list. This process continues until the entire list is sorted.
+
+INTRODUCTION
+
+The merge sort algorithm consists of two main steps: the divide step and the merge step. In the divide step, the unsorted list is divided into two halves until each sublist contains only one element or is empty. This is done recursively until all sublists are sorted.
+
+In the merge step, the sorted sublists are merged back together by comparing the elements from each sublist and placing them in the correct order. This process continues until all sublists are merged into a single sorted list.
+
+One of the key advantages of merge sort is its efficiency and stability. It has a time complexity of O(n log n) in the worst case, making it efficient for sorting large datasets. Additionally, merge sort is a stable sorting algorithm, meaning that it preserves the relative order of equal elements in the sorted list.
+
+Overall, merge sort is a reliable and efficient sorting algorithm that is widely used in various applications. It provides a consistent performance and guarantees a sorted output, making it a valuable tool in computer science and data processing.
+
+CODE
+
+Python
+
+```
+#Copyrights to venkys.io
+#For more programs visit venkys.io
+#Python program for Merge sort
+
+def merge_sort(array):
+ # Divide strategy
+ if len(array) > 1:
+
+ # Finding the mid index of the array
+ midx = len(array)//2
+
+ # Dividing the array elements
+ Larray = array[:midx]
+ Rarray = array[midx:]
+
+ merge_sort(Larray)
+ merge_sort(Rarray)
+
+ # Conqure strategy
+
+ idx1 = 0 # to track left array
+ idx2 = 0 # to track right array
+ idx = 0 # to track array
+
+ while idx1 < len(Larray) and idx2 < len(Rarray):
+ if Larray[idx1] < Rarray[idx2]:
+ array[idx] = Larray[idx1]
+ idx1 += 1
+ else:
+ array[idx] = Rarray[idx2]
+ idx2 += 1
+ idx += 1
+
+ # sorting the remaining elements
+
+ while idx1 < len(Larray):
+ array[idx] = Larray[idx1]
+ idx1 += 1
+ idx += 1
+
+ while idx2 < len(Rarray):
+ array[idx] = Rarray[idx2]
+ idx2 += 1
+ idx += 1
+
+# Test drive code
+if __name__=="__main__":
+ n=7
+ array=[34, 2, 12, 96, 456, 899, 24]
+ merge_sort(array)
+ print(*array)
+
+```
+Step-by-Step Explanation:
+
+1. The merge_sort function takes an array as input and implements the merge sort algorithm.
+2. In the divide strategy, if the length of the array is greater than 1, the algorithm finds the mid index of the array and divides it into two halves.
+3. The left half of the array is assigned to the Larray variable, and the right half is assigned to the Rarray variable.
+4. The merge_sort function is called recursively for both the left and right halves to further divide them until each sublist contains only one element or is empty.
+5. In the conquer strategy, three index variables (idx1, idx2, and idx) are initialized to keep track of the position in the left array, right array, and original array, respectively.
+6. While both idx1 and idx2 are less than the lengths of Larray and Rarray respectively, the algorithm compares the elements at the corresponding positions and places the smaller element in the original array.
+7. After the previous step, there may be remaining elements in either Larray or Rarray. The algorithm then copies the remaining elements into the original array.
+8. Once the merge_sort function completes, the original array will be sorted in ascending order.
+9. The test drive code initializes an array with 7 elements and calls the merge_sort function on it.
+10. Finally, the sorted array is printed as output.
+
+JAVA
+
+```
+// Copyrights to venkys.io
+//For more programs visit venkys.io
+//Java program for Merge sort
+
+
+public class Main {
+
+
+ static void VSDmerge(int[] array,int l, int r)
+ {
+ if(lStep-by-Step Explanation:
+
+1. The Java code provided implements the merge sort algorithm to sort an array of integers.
+2. The VSDmerge method is a recursive function that performs the merge sort algorithm. It takes three parameters: the array to be sorted, the left index, and the right index.
+3. Inside the VSDmerge method, the middle index m is calculated as l + (r - l) / 2, which represents the midpoint of the array.
+4. The VSDmerge method is recursively called on the left half of the array (l to m) and the right half of the array (m+1 to r).
+5. The VSDMergesort method is used to merge the divided subarrays in sorted order. It takes four parameters: the array, the left index l, the middle index m, and the right index r.
+6. In the VSDMergesort method, two temporary arrays, Left and Right, are created to store the divided elements of the original array.
+7. The elements of the divided subarrays are assigned to the Left and Right arrays accordingly.
+8. Using three index variables (i, j, and k), the elements from Left and Right arrays are compared and merged back into the original array in sorted order.
+9. After merging the elements, any remaining elements in either the Left or Right arrays are appended to the original array.
+10. Once the VSDmerge and VSDMergesort methods complete their execution, the original array will be sorted in ascending order.
+11. The VSDprintOutput method is used to print the sorted array as output.
+12. In the main method, an array of integers is declared and initialized.
+13. The VSDmerge method is called with the array and the indices of the first and last elements of the array.
+14. Finally, the VSDprintOutput method is called to print the sorted array.
+
+CPP
+
+```
+// Copyrights to venkys.io
+// For more programs visit venkys.io
+// CPP program for Merge sort
+
+#include
+
+using namespace std;
+
+// Merge two subarrays of arr[]
+// First subarray is arr[l..m]
+// Second subarray is arr[m+1..r]
+
+void VSDmerge(int arr[], int l, int m, int r) {
+ // Calculate sizes of the two subarrays
+ int n1 = m - l + 1;
+ int n2 = r - m;
+
+ // Create temporary arrays to store the data of the two subarrays
+ int left[n1];
+ int right[n2];
+
+ // Copy data to temporary arrays left[] and right[]
+ for (int i = 0; i < n1; i++) {
+ left[i] = arr[l + i];
+ }
+ for (int j = 0; j < n2; j++) {
+ right[j] = arr[m + 1 + j];
+ }
+
+ // Merge the temporary arrays back into arr[l..r]
+ int i = 0; // Initial index of the first subarray
+ int j = 0; // Initial index of the second subarray
+ int k = l; // Initial index of the merged subarray
+
+ // Compare elements of the two subarrays and merge them in ascending order
+ while (i < n1 && j < n2) {
+ if (left[i] <= right[j]) {
+ arr[k] = left[i];
+ i++;
+ } else {
+ arr[k] = right[j];
+ j++;
+ }
+ k++;
+ }
+
+ // Copy the remaining elements of left[], if there are any
+ while (i < n1) {
+ arr[k] = left[i];
+ i++;
+ k++;
+ }
+
+ // Copy the remaining elements of right[], if there are any
+ while (j < n2) {
+ arr[k] = right[j];
+ j++;
+ k++;
+ }
+}
+
+// Recursive function to perform merge sort on the array
+void VSDmergesort(int arr[], int l, int r) {
+ if (l < r) {
+ // Same as (l+r)/2, but avoids overflow for large l and r
+ int m = l + (r - l) / 2;
+
+ // Recursively sort the first and second halves
+ VSDmergesort(arr, l, m);
+ VSDmergesort(arr, m + 1, r);
+
+ // Merge the sorted halves
+ VSDmerge(arr, l, m, r);
+ }
+}
+
+int main() {
+ int n = 7;
+ int arr[] = {34, 2, 12, 96, 456, 899, 24};
+
+ // Call the merge sort function
+ VSDmergesort(arr, 0, n - 1);
+
+ // Print the sorted array
+ cout << "Sorted array: ";
+ for (int i = 0; i < n; i++) {
+ cout << arr[i] << " ";
+ }
+ cout << endl;
+
+ return 0;
+}
+
+```
+Step-by-Step Explanation:
+
+1. The C++ code provided implements the merge sort algorithm to sort an array of integers.
+2. The VSDmerge function is defined to merge two subarrays of the array. It takes four parameters: the array to be sorted, the left index, the middle index, and the right index.
+3. Inside the VSDmerge function, the sizes of the two subarrays are calculated: n1 for the left subarray and n2 for the right subarray.
+4. Temporary arrays left and right are created to store the elements of the left and right subarrays, respectively.
+5. The elements from the original array are copied to the temporary arrays left and right.
+6. The elements of the temporary arrays are merged back into the original array in sorted order. The variables i, j, and k are used as indices to compare and merge the elements.
+7. Any remaining elements in either the left or right subarray are copied to the original array.
+8. The VSDmergesort function is defined to perform the merge sort algorithm recursively. It takes three parameters: the array to be sorted, the left index, and the right index.
+9. Inside the VSDmergesort function, if the left index is less than the right index, the middle index m is calculated as l + (r - l) / 2.
+10. The VSDmergesort function is recursively called for the left half of the array (l to m) and the right half of the array (m+1 to r).
+11. Finally, the main function initializes an array of integers and calls the VSDmergesort function to sort the array. The sorted array is then printed as output.
+
+OUTPUT
+
+The sorted order is: 2 12 24 34 96 456 899
+
+Time and Space complexity analysis:
+
+The time and space complexity analysis for the merge sort algorithm is as follows:
+
+**Time Complexity:**
+
+- Best Case: O(n log n)
+- Average Case: O(n log n)
+- Worst Case: O(n log n)
+
+The merge sort algorithm follows the divide-and-conquer approach, where the unsorted list is divided into smaller sublists until each sublist contains only one element or is empty. Then, the sorted sublists are merged back together to form a sorted list.
+
+In each recursive call, the merge sort algorithm divides the list into two halves, which takes O(log n) time. Then, during the merge step, it compares and merges the elements from the sublists, which takes O(n) time in the worst case. Since the list is divided recursively into halves, the overall time complexity of merge sort is O(n log n).
+
+**Space Complexity:**
+The space complexity of merge sort is O(n) because it requires auxiliary space to store the temporary subarrays during the merge step. In each recursive call, the merge sort algorithm creates temporary arrays to store the divided elements. The size of these temporary arrays is equal to the size of the original array, resulting in a space complexity of O(n).
+
+Overall, merge sort is an efficient sorting algorithm with a time complexity of O(n log n) and a space complexity of O(n). It provides stable sorting, meaning that it preserves the relative order of equal elements in the sorted list. Merge sort is widely used in various applications where stability and efficiency are important factors.
+
+Real-World Applications of Merge Sort:
+
+Merge sort has several real-world applications due to its efficiency, stability, and ability to handle large datasets. Some notable applications of merge sort include:
+
+1. **Sorting Algorithms**: Merge sort is often used as a benchmark for other sorting algorithms due to its consistent performance and efficiency. It is commonly used to sort arrays, lists, and other data structures in programming languages.
+2. **External Sorting**: Merge sort's ability to efficiently handle large datasets makes it suitable for external sorting. External sorting is used when the data to be sorted exceeds the available memory. Merge sort's divide-and-conquer approach allows it to efficiently sort data that is too large to fit in memory by using disk-based operations.
+3. **File Merge Operations**: Merge sort is used in various file processing operations, such as merging multiple sorted files into a single sorted file. This is commonly seen in database systems, where large datasets are stored in multiple files and need to be merged for efficient querying and analysis.
+4. **Inversion Count**: Merge sort is also used to calculate the inversion count of an array. An inversion is a pair of elements in an array that are out of order. By counting the number of inversions, it is possible to measure the similarity between two datasets or to detect anomalies in data.
+5. **External Merge Sort**: Merge sort is a key component of external merge sort algorithms, which are used to sort large datasets that do not fit entirely in memory. External merge sort divides the data into smaller chunks, sorts them using merge sort, and then merges the sorted chunks to produce the final sorted result.
+6. **Parallel Computing**: Merge sort can be parallelized, making it suitable for parallel computing environments. By dividing the data and sorting the sublists in parallel, merge sort can achieve faster sorting times on systems with multiple processors or cores.
+
+Overall, merge sort's efficiency, stability, and ability to handle large datasets make it a valuable tool in various real-world applications that involve sorting and managing large amounts of data.
+
+
+
From 0cb0e8fd09f1bfbc69731cdcb50375c237b8bb9e Mon Sep 17 00:00:00 2001
From: jayakrishna78 <127725197+jayakrishna78@users.noreply.github.com>
Date: Fri, 29 Dec 2023 20:11:00 +0530
Subject: [PATCH 2/3] Update README.md
---
Sorting/Hard/MergeSort/README.md | 346 +++++++++++++++++++------------
1 file changed, 209 insertions(+), 137 deletions(-)
diff --git a/Sorting/Hard/MergeSort/README.md b/Sorting/Hard/MergeSort/README.md
index 1f08f40c..a43365c1 100644
--- a/Sorting/Hard/MergeSort/README.md
+++ b/Sorting/Hard/MergeSort/README.md
@@ -23,51 +23,58 @@ Overall, merge sort is a reliable and efficient sorting algorithm that is widely
def merge_sort(array):
# Divide strategy
- if len(array) > 1:
+ if len(array) > 1:
+ # Finding the mid index of the array
+ midx = len(array) // 2
+
+ # Dividing the array elements into left and right subarrays
+ Larray = array[:midx]
+ Rarray = array[midx:]
+
+ # Recursively apply merge_sort on left and right subarrays
+ merge_sort(Larray)
+ merge_sort(Rarray)
+
+ # Conquer strategy
+ idx1 = 0 # Initialize index for the left subarray
+ idx2 = 0 # Initialize index for the right subarray
+ idx = 0 # Initialize index for the merged array
+
+ # Merge the left and right subarrays in sorted order
+ while idx1 < len(Larray) and idx2 < len(Rarray):
+ if Larray[idx1] < Rarray[idx2]:
+ array[idx] = Larray[idx1]
+ idx1 += 1
+ else:
+ array[idx] = Rarray[idx2]
+ idx2 += 1
+ idx += 1
+
+ # Sorting the remaining elements in the left subarray
+ while idx1 < len(Larray):
+ array[idx] = Larray[idx1]
+ idx1 += 1
+ idx += 1
+
+ # Sorting the remaining elements in the right subarray
+ while idx2 < len(Rarray):
+ array[idx] = Rarray[idx2]
+ idx2 += 1
+ idx += 1
- # Finding the mid index of the array
- midx = len(array)//2
-
- # Dividing the array elements
- Larray = array[:midx]
- Rarray = array[midx:]
+# Test drive code
+if __name__ == "__main__":
+ # Reading the size of the array from STDIN
+ n = int(input("Enter the size of the array: "))
- merge_sort(Larray)
- merge_sort(Rarray)
-
- # Conqure strategy
-
- idx1 = 0 # to track left array
- idx2 = 0 # to track right array
- idx = 0 # to track array
-
- while idx1 < len(Larray) and idx2 < len(Rarray):
- if Larray[idx1] < Rarray[idx2]:
- array[idx] = Larray[idx1]
- idx1 += 1
- else:
- array[idx] = Rarray[idx2]
- idx2 += 1
- idx += 1
-
- # sorting the remaining elements
-
- while idx1 < len(Larray):
- array[idx] = Larray[idx1]
- idx1 += 1
- idx += 1
-
- while idx2 < len(Rarray):
- array[idx] = Rarray[idx2]
- idx2 += 1
- idx += 1
+ # Reading the array elements from STDIN
+ array = list(map(int, input("Enter the array elements separated by space: ").split()))
-# Test drive code
-if __name__=="__main__":
- n=7
- array=[34, 2, 12, 96, 456, 899, 24]
+ # Applying merge_sort to the array
merge_sort(array)
- print(*array)
+
+ # Printing the sorted array
+ print("Sorted Array:", *array)
```
Step-by-Step Explanation:
@@ -90,99 +97,139 @@ if __name__=="__main__":
//For more programs visit venkys.io
//Java program for Merge sort
+import java.util.Scanner;
-public class Main {
-
-
- static void VSDmerge(int[] array,int l, int r)
- {
- if(lStep-by-Step Explanation:
-1. The Java code provided implements the merge sort algorithm to sort an array of integers.
-2. The VSDmerge method is a recursive function that performs the merge sort algorithm. It takes three parameters: the array to be sorted, the left index, and the right index.
-3. Inside the VSDmerge method, the middle index m is calculated as l + (r - l) / 2, which represents the midpoint of the array.
-4. The VSDmerge method is recursively called on the left half of the array (l to m) and the right half of the array (m+1 to r).
-5. The VSDMergesort method is used to merge the divided subarrays in sorted order. It takes four parameters: the array, the left index l, the middle index m, and the right index r.
-6. In the VSDMergesort method, two temporary arrays, Left and Right, are created to store the divided elements of the original array.
-7. The elements of the divided subarrays are assigned to the Left and Right arrays accordingly.
-8. Using three index variables (i, j, and k), the elements from Left and Right arrays are compared and merged back into the original array in sorted order.
-9. After merging the elements, any remaining elements in either the Left or Right arrays are appended to the original array.
-10. Once the VSDmerge and VSDMergesort methods complete their execution, the original array will be sorted in ascending order.
-11. The VSDprintOutput method is used to print the sorted array as output.
-12. In the main method, an array of integers is declared and initialized.
-13. The VSDmerge method is called with the array and the indices of the first and last elements of the array.
-14. Finally, the VSDprintOutput method is called to print the sorted array.
+1.Import Statements:
+ import java.util.Scanner;: Imports the Scanner class for reading input from the console.
+
+2.Class Declaration:
+ public class MergeSort {: Declares a class named MergeSort.
+
+3.mergeSort Function:
+ static void mergeSort(int[] array, int l, int r) {: This is the main function for the merge sort algorithm.
+ if (l < r) {: Checks if the array has more than one element.
+ int m = l + (r - l) / 2;: Calculates the middle index of the array.
+ mergeSort(array, l, m);: Recursively calls mergeSort on the left subarray.
+ mergeSort(array, m + 1, r);: Recursively calls mergeSort on the right subarray.
+ merge(array, l, m, r);: Calls the merge function to combine the sorted subarrays.
+
+4.merge Function:
+ static void merge(int[] array, int l, int m, int r) {: Merges two sorted subarrays.
+ int n1 = m - l + 1;: Calculates the size of the left subarray.
+ int n2 = r - m;: Calculates the size of the right subarray.
+ int[] left = new int[n1];: Creates a temporary array for the left subarray.
+ int[] right = new int[n2];: Creates a temporary array for the right subarray.
+ Copies elements from the original array to the temporary arrays.
+ Initializes indexes (i, j, k) for merging the subarrays.
+ Compares elements from the left and right subarrays and arranges them in sorted order.
+
+5.printOutput Function:
+ public static void printOutput(int[] array) {: Prints the sorted array.
+ Iterates through the array and prints each element.
+
+6.Main Function:
+ public static void main(String args[]) {: The main function where the program execution begins.
+ Creates a Scanner object to read input.
+ Reads the size of the array (size) from the user.
+ Creates an array (array) to store the elements.
+ Reads the array elements from the user.
+ Calls mergeSort to sort the array.
+ Calls printOutput to print the sorted array.
+ Closes the Scanner to release resources.
+
+This program uses the merge sort algorithm to sort an array and prints the sorted order to the console. It takes user input for the size of the array and the array elements.
CPP
@@ -191,15 +238,12 @@ public static void main(String args[]) {
// For more programs visit venkys.io
// CPP program for Merge sort
-#include
-
-using namespace std;
+#include
// Merge two subarrays of arr[]
// First subarray is arr[l..m]
// Second subarray is arr[m+1..r]
-
-void VSDmerge(int arr[], int l, int m, int r) {
+void merge(int arr[], int l, int m, int r) {
// Calculate sizes of the two subarrays
int n1 = m - l + 1;
int n2 = r - m;
@@ -249,33 +293,44 @@ void VSDmerge(int arr[], int l, int m, int r) {
}
// Recursive function to perform merge sort on the array
-void VSDmergesort(int arr[], int l, int r) {
+void mergeSort(int arr[], int l, int r) {
if (l < r) {
// Same as (l+r)/2, but avoids overflow for large l and r
int m = l + (r - l) / 2;
// Recursively sort the first and second halves
- VSDmergesort(arr, l, m);
- VSDmergesort(arr, m + 1, r);
+ mergeSort(arr, l, m);
+ mergeSort(arr, m + 1, r);
// Merge the sorted halves
- VSDmerge(arr, l, m, r);
+ merge(arr, l, m, r);
}
}
int main() {
- int n = 7;
- int arr[] = {34, 2, 12, 96, 456, 899, 24};
+ int n;
+
+ // Read the size of the array from STDIN
+ std::cout << "Enter the size of the array: ";
+ std::cin >> n;
+
+ int arr[n];
+
+ // Read the array elements from STDIN
+ std::cout << "Enter the array elements separated by space: ";
+ for (int i = 0; i < n; i++) {
+ std::cin >> arr[i];
+ }
// Call the merge sort function
- VSDmergesort(arr, 0, n - 1);
+ mergeSort(arr, 0, n - 1);
// Print the sorted array
- cout << "Sorted array: ";
+ std::cout << "Sorted array: ";
for (int i = 0; i < n; i++) {
- cout << arr[i] << " ";
+ std::cout << arr[i] << " ";
}
- cout << endl;
+ std::cout << std::endl;
return 0;
}
@@ -283,17 +338,34 @@ int main() {
```
Step-by-Step Explanation:
-1. The C++ code provided implements the merge sort algorithm to sort an array of integers.
-2. The VSDmerge function is defined to merge two subarrays of the array. It takes four parameters: the array to be sorted, the left index, the middle index, and the right index.
-3. Inside the VSDmerge function, the sizes of the two subarrays are calculated: n1 for the left subarray and n2 for the right subarray.
-4. Temporary arrays left and right are created to store the elements of the left and right subarrays, respectively.
-5. The elements from the original array are copied to the temporary arrays left and right.
-6. The elements of the temporary arrays are merged back into the original array in sorted order. The variables i, j, and k are used as indices to compare and merge the elements.
-7. Any remaining elements in either the left or right subarray are copied to the original array.
-8. The VSDmergesort function is defined to perform the merge sort algorithm recursively. It takes three parameters: the array to be sorted, the left index, and the right index.
-9. Inside the VSDmergesort function, if the left index is less than the right index, the middle index m is calculated as l + (r - l) / 2.
-10. The VSDmergesort function is recursively called for the left half of the array (l to m) and the right half of the array (m+1 to r).
-11. Finally, the main function initializes an array of integers and calls the VSDmergesort function to sort the array. The sorted array is then printed as output.
+1.Include Header:
+ #include : Includes the iostream header for input and output operations.
+
+2.Merge Function:
+ void merge(int arr[], int l, int m, int r): Function to merge two sorted subarrays.
+ Calculates sizes of two subarrays, creates temporary arrays, and copies data.
+ Merges the temporary arrays back into the original array in sorted order.
+
+3.Merge Sort Function:
+ void mergeSort(int arr[], int l, int r): Recursive function for merge sort.
+ Divides the array into two halves, recursively sorts each half, and then merges them.
+
+4.Main Function:
+ int main() {: The main function where the program execution begins.
+ Reads the size of the array (n) from STDIN.
+ Creates an array (arr) to store the elements.
+ Reads the array elements from STDIN.
+ Calls mergeSort to sort the array.
+ Prints the sorted array to STDOUT.
+
+5.Input and Output:
+ std::cout << "Enter the size of the array: ";: Prompts the user to enter the size of the array.
+ std::cin >> n;: Reads the size of the array from the user.
+ std::cout << "Enter the array elements separated by space: ";: Prompts the user to enter the array elements.
+ std::cin >> arr[i];: Reads each array element from the user.
+ After sorting, the sorted array is printed to the console.
+
+This program uses the merge sort algorithm to sort an array and interacts with the user through STDIN and STDOUT. The use of functions and comments enhances code readability and maintainability.
OUTPUT
From b8a7bb7a687224dfb65918cb60c699609669ed3e Mon Sep 17 00:00:00 2001
From: jayakrishna78 <127725197+jayakrishna78@users.noreply.github.com>
Date: Sun, 31 Dec 2023 14:50:12 +0530
Subject: [PATCH 3/3] Update README.md
---
Sorting/Hard/MergeSort/README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/Sorting/Hard/MergeSort/README.md b/Sorting/Hard/MergeSort/README.md
index a43365c1..dcc16109 100644
--- a/Sorting/Hard/MergeSort/README.md
+++ b/Sorting/Hard/MergeSort/README.md
@@ -367,9 +367,6 @@ int main() {
This program uses the merge sort algorithm to sort an array and interacts with the user through STDIN and STDOUT. The use of functions and comments enhances code readability and maintainability.
-OUTPUT
-
-The sorted order is: 2 12 24 34 96 456 899
Time and Space complexity analysis: