The Merge Sort is one of the most efficient sorting algorithms. It is based on the divide-and-conquer method. In this article, I am going to explain how the algorithm works and why it is so efficient.

The merge sort algorithm belongs to the family of efficient sorting algorithms whose average complexity is O(n log(n)). This is the best performance that can be achieved with a comparison-based algorithm.

It is also an example of a divide-and-conquer method. This method solves a problem recursively, applying the three steps of recursion:

  • Divide the problem into a number of small subproblems.
  • Conquer the subproblems…

Andrea Cappelletti

Make it inspire 🌐

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