Merge sort:
Merge sort is a sorting algorithm that uses the idea of split and conquers. This algorithm splits the array into two halves, sorts them separately and then merges them. This process is recursive, with the base criterion-the number of elements in the array is not more than 1. Assume variable low and high shows the index of the first and last element of the array respectively, the merge sort can be described recursively as
If(low
Divide the list into two halves
Mergesort the left half
Mergesort the right half
Mergesort the two sorted halves into one sorted list