**Objective :** Write Merge Sort algorithm to sort elements in an array

**Input:** A unsorted array, arrA[].

**Output :** A sorted array.

**Approach:**

**Divide and Conquer: **In this approach we divide the main problems into smaller problems, solve them and merge the results to get the final result.

**How Divide and conquer works in Merge Sort:**

We divide the elements into two half’s by middle of the array. We solve the left half and right half recursively and merge the results.

Merging:

Once the sorting is done individually on both the half’s, our next task will be merge them. To merge we start with both the arrays at the beginning, pick the smaller one put into array and then compare the next elements and so on.

Read more