Count number of inversions in an array

Coursera: Algorithms: Design and Analysis, Part 1
by Tim Roughgarden
Implementation of algorithms in week1