We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
How did you find the logic to calcuate the value of count? Is there someplace I can read about it more?
count+=mid+1-i;
Second. I made a mistake of swapping aux and arr in the following code based on the function definition and I was getting my answer wrong. Why are you switching? What is the reasoning behind it?
Merge Sort: Counting Inversions
You are viewing a single comment's thread. Return to all comments →
I have two questions related to your answer.
How did you find the logic to calcuate the value of count? Is there someplace I can read about it more?
Second. I made a mistake of swapping aux and arr in the following code based on the function definition and I was getting my answer wrong. Why are you switching? What is the reasoning behind it?