Inversions
This was taught in Algorithms: Design and Analysis Part I on coursera - how to count inversions.
What is an inversion? An inversion is a pair of objects that are out of order. If we are given an array and our goal is to sort from low to high, an inversion would be two items ai and aj such that ai > aj, but i < j. We can see that they are misplaced.
[Read More]