Inversion count

not getting output displayed
code link:

@Vishal123
Issues with your indexing. Your indexing is wrong by 1 at several instances in your code. For example , the right of mergesort is initialised to n at the beginning instead of n-1. Similarly , the j in your merge() gets initialised from mid instead of mid+1. The i loop in same function should go from i=left till i<=mid.

Refer to my code - https://ide.codingblocks.com/s/172061

Most of the code is actually same. Just changing the indexing at some instances will make your code work.