00:02
In this question, we are given the numbers 3, 6, 9, 4, 2, 10, 8, 1, 7 and 5.
00:15
So we are asked to sort these numbers using the merge sort algorithm.
00:21
So we know that the first step of the merge sort algorithm is to check if the left index of array is less than the right index.
00:39
And if yes, we will calculate its midpoint.
00:42
So first, here we can observe that there are a total of 10 elements.
00:47
So we will divide the merge sort into two equal halves, which is 5 each.
00:51
So in the one half, we will have 3, 6, 9, 4, 2.
00:57
And on the other half, we will have 10, 8, 1, 7 and 5.
01:03
Now these two halves, we will further divide it into other halves, that is, we will take 3, 6, 9 as one part, 4 and 2 is the other part.
01:14
Here we will have 10, 8, 1 as one part and 7, 5 as the other part.
01:23
Now we will further divide these two arrays into further halves until the atomic units of the array is reached and further division is not possible.
01:31
That is, we are going to divide them as 3, 6, 9, 4, 2, 10, 8, 1, 7, 5.
01:43
So we will compare the first element for each list and then combine them into another list in increasing sorted manner.
01:50
That is, so after 3, 6, this is an increasing order, 4 and 9, 4 is the smallest, so 4 and 9, 2 and 10 is perfect...