题目原文: An inversion in an array a[] is a pair of entries a[i] and a[j] such that i<j but a[i]>a[j]. Given an array, design a linearithmic algorithm to count the number of inversions. 分析: 如果没有性能限制,用插入排序算法可以实现.题目性能被限制在nlogn,又是归并排序的练习题,很显然要实现个归并排序,并在里面计…