firstin the bottom half of the arrayrange - and range - are merged into range - of course - and - aren' really rangesthey're only one elementso they are base cases similarly - and - are merged into - then ranges - and - are merged - in the top half of the array - and - are merged into - - and - are merged into - and - and - are merged into - finally the top half - and the bottom half are merged into the complete array - which is now sorted when the array size is not power of arrays of different sizes must be merged for examplefigure shows the situation in which the array size is here an array of size must be merged with an array of size to form an array of size figure array size not power of first the -element ranges - and - are merged into the -element range - then range - is merged with the -element range - this creates -element range - it' merged with the -element range - the process continues until the array is sorted notice that in mergesort we don' merge two separate arrays into third oneas we