Merge Sort:
Print this page

We can assume each element in a given array as a sorted sub array.Take adjacent arrays and merge to obtain a sorted array of two elements. Next step, take adjacent sorted arrays, of size two, in pair and merge them to get a sorted array of four elements. Repeat the step until whole array is sorted.

Following figure illustrates the procedure.


   
An Applet Demonstration of Merge Sort
 
Prev