Merge Sort

Let’s learn about the merge sort algorithm and its implementation.

Introduction

Merge sort recursively partitions the input into two halves. The two halves are then sorted independently before being combined into the final sorted output. The recursive step keeps on dividing the input into smaller pieces until the length of each piece becomes one.

Let’s look at an illustration of the merge sort in action.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.