Hello @vijayraghav18,
Yes, that’s exactly what would happen.
And that’s what i have explained.
Let’s understand with an example:
1: refers to the initial unsorted array.
At each step it will break into two half:
____________ 1
______2 __________3
___4 ______5 __6 ______7
Explanation:
Top Down Movement:
First 1 will break into two halves 2 and 3.
Then 2 will break into 4 and 5
Bottom Up Movement:
as 4 is containing a single element, so we will return.
Now, going to right half, 5 is also a single element array. So, return.
Now, merge 4 and 5 and return.
So, two is now sorted.
Above was the left half of 1 which is sorted now.
Now, we will go to the right half.
3 will break into 6 and 7 and the similar pattern will follow.
Observation:
For each node as the current node,
first left half will be sorted
then right half
Finally we will merge the two in sorted order.
Hope, it is clear now.