Merge Sort Algorithm

Merge Sort is an algorithm use divide and conquer approach in which the array is split in two halves, calls itself for the two halves and then merges the two sorted halves on which we try to perform merge sort.

So in merge sort we will break array into sub arrays, these subarrays into even smaller subarrays, until we have multiple subarrays with single element in them. Now, the idea here is that an array with a single element is already sorted, so once we break the original array into subarrays which has only a single element, we have successfully broken down our problem into base problems.

Let’s consider an array with values {16, 9, 5, 14, 11, 13, 8, 14}

Merge Sort Example in C#

Leave a Reply

Your email address will not be published. Required fields are marked *