How is this possible?

int x = inversion_count(arr,s,mid);. How can just dividing the array into 2 parts give a value? we are not doing a comparison right?

hello @JaveedYara

to understand this u need to have good knopwledge of recursion and working of mergesort.
basically we are calculating the answer recursively.
i,e first we break array in two parts which will return their answer .
and then we willl use merge algorithm to calculate the overall result of the resultant array.

i am attaching an article . once go through it and ping me back if u need any help regarding this.
inversion count working