Merge sort follows the approach of Divide and Conquer.
Divide means breaking a problem into many small sub problems.
Conquer means solving those small sub problems recursively and then recombine them to create a solution of the original problem.
The method MergeSort() breaks the array into equal parts until every element get separated and then the method Merge() recombines them while sorting them every time it joins two arrays it joins them in a sorted way so that we get a final sorted array.
Program for Merge Sort in C++
Output