In standard merge sort we have 3 steps. a) spliting array. b) sorting array recursively. c) merging both array. first step don't need any comparision , nor laststep .. only step b requires comparision . let us assume we have 8 elements in our list .so break up will be like that. 8. 4 4
MergeSort will always have the same number of data moves for arrays of equal sizes because the data is simply being moved between source and target arrays for each of the "steps" of merge. In terms of comparisons, the best case for a single merge is when the largest in one half is less than or equal to the smallest in the other half, like this ...
Merge sort runs in O (n log n) running time. It is very efficient sorting algorithm with near optimal number of comparison. Recursive algorithm used for merge sort comes under the category of divide and conquer technique. An array of n elements is split around its center producing two smaller arrays.