Merge sort is an efficient, general-purpose, comparison-based sorting algorithm. Merge sort is a divide and conquer algorithm that was invented by John von Neumann in 1945.It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves.The merge() function is used for merging two halves
- The input consists of two lines.
- In the first line, there will be a single integer N.
- In the second line, there will be N space separated integers.
- There will be N space separated integers sorted in increasing order.
8
98 45 34 12 56 67 89 1
1 12 34 45 56 67 89 98