I am confused how x and y are increased

value of x and y are also calculated when merge in applied but how when we apply merge on very small parts it would update z not x and y

@guptanikhil898 to calculate the value of x and y, we recursively call on the left and right subarrays and it’ll be calculated due to recursive calls of merging on those subarrays. Sir has coded it out as well, see that and it’ll be more clear

then how z is calculated if by calling merging on subarrays we are getting x and y
can you show calcultion of x and y by recurssive
tree

@guptanikhil898 have you seen the code? z is calculated by the merge function, and x and y are calculated by the recursive calls. In recursion, you shouldn’t worry about the smaller subproblems, they will be taken care of, Rather focus on the problem at hand, ie the current problem.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.