We are given a sequence of n nos. a1, a2, a3,.......an, we will assume that all the nos. are distinct. We say two indices i < j form an inversion if ai > aj .
How much time will it take to find total no. of inversions in the given array?
a) O(n2) b) O(nlogn) c) O(n) d) none of these