Sign in
Log inSign up
Merge Sort

Merge Sort

Mohammad Salhab's photo
Mohammad Salhab
·May 18, 2022·

1 min read

What is Merge sort?

Merge sort is one of the sorting techniques that work on the principle of Divide and Conquer.

How does it work?

The list is repeatedly divided into two until all the elements are separated individually. Pairs of elements are then compared, placed into order, and combined. The process is then repeated until the list is recompiled as a whole.

Merge Sort for blog.jpg

Merge Sort for blog (1).jpg

Efficency

Time Complexity: O(nlogn)

Space Complexity: O(n)