Example 3: Merge Sort

Learn what a merge sort is, and learn how it works.

Previously in this course, we learned two sorting algorithms: selection sort and insertion sort. We have another sorting algorithm which is recursive in nature, and it is known as merge sort.

Introduction

A merge sort recursively breaks the values to be sorted in half until there is only one value to be sorted, and then it merges the sorted lists/arrays into one sorted list/array. Here’s a basic overview of the process:

Get hands-on with 1400+ tech skills courses.