Similar to Quick Sort, this recursively splits arrays or data structures and builds them back in the right order by merging. This is a usually stable sorting approach.

Merge sort is of O(n log n) time and O(n) space complexity.

Methodology

  1. Split the data structure in 2 halves
  2. Recursively sort the halves
  3. Merge the results