arr[karr[pos]arr[postemp merge sort merge sort is sorting algorithm that uses the divideconquerand combine algorithmic paradigm divide means partitioning the -element array to be sorted into two sub-arrays of / elements if is an array containing zero or one elementthen it is already sorted howeverif there are more elements in the arraydivide into two sub-arraysa and each containing about half of the elements of conquer means sorting the two sub-arrays recursively using merge sort combine means merging the two sorted sub-arrays of size / to produce the sorted array of elements merge sort algorithm focuses on two main concepts to improve its performance (running time) smaller list takes fewer steps and thus less time to sort than large list as number of steps is relatively lessthus less time is needed to create sorted list from two sorted lists rather than creating it using two unsorted lists the basic steps of merge sort algorithm are as followsif the array is of length or then it is already sorted otherwisedivide the unsorted array into two sub-arrays of about half the size use merge sort algorithm recursively to sort each sub-array merge the two sub-arrays to form single sorted list example sort the array given below using merge sort solution (divide and conquer the array (combine the elements to form sorted arraythe merge sort algorithm (fig uses function merge which combines the sub-arrays to form sorted array while the merge sort algorithm recursively divides the list into smaller liststhe merge algorithm conquers the list to sort the elements in individual lists finallythe smaller lists are merged to form one list to understand the merge algorithmconsider the figure below which shows how we merge two lists to form one list for ease of understandingwe have taken two sub-lists each containing four elements the same concept can be utilized to merge four sub-lists containing two elementsor eight sub-lists having one element each begi mid temp end index