Explain about the merge sort algorithm

Explain about the merge sort algorithm.

E

Expert

Verified

A merge sort algorithm which splits the items to be sorted within two groups, recursively sorts all groups, and merges them in a last, sorted sequence. Run time is as T(n log n).

When n<2 then the array is previously sorted. Stop here.

If not, n>1, and we perform the three steps in sequence as given below:

• Sort the left and right half of the array.

• Merge the here-sorted right and left halves.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.