Merge Sort Algorithm
OBJECTIVES:
1. Define and understand the concept of merge sort
[Link] the process of merge sort
• Merge Sort is a kind of Divide and Conquer
algorithm in computer programming. It is one
of the most popular sorting algorithms and a
great way to develop confidence in building
recursive algorithms. One of the most
efficient sorting algorithms.
• Merge sort repeatedly breaks down a list into
several sublists until each sublist consists of
a single element and merging those sublists
in a manner that results into a sorted list.
• In Merge Sort, the given unsorted array
with n elements, is divided into n subarrays, each
having one element, because a single element is
always sorted in itself. Then, it repeatedly merges
these subarrays, to produce new sorted subarrays,
and in the end, one complete sorted array is produced.
The concept of Divide and Conquer involves three steps:
• Divide the problem into multiple small problems.
• Conquer the subproblems by solving them. The idea
is to break down the problem into atomic subproblems,
where they are actually solved.
• Combine the solutions of the subproblems to find the
solution of the actual problem.
Another Example:
Let's consider an array with values