INTRODUCTION

As we all know there are many sorting algorithms are available. Basically, we can divide the sorting algorithm into two categories comparison-based sorting and non-comparison-based sorting algorithm. Merge sort comes under comparison-based sorting and it is the best case study of the divide and conquer technique. now we can cover the following points:-
1. Very famous algorithm for sorting.
2. The very old algorithm used even today for sorting.
3. The complexity of the algorithm is O(N log N) in best, average, and worst cases.
It is a stable and comparative sorting algorithm having the lowest bound for comparison-based sorting methods.

EXPLANATION

Suppose we have an of length n. Now we have to follow the below mention step to sort an array.
Divide the array of length n into the two-part first one of the size of n/2 and the second one of the n-n/2 length. we can call the first…

Pranshur Goel

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store