Shawn1380 / Counting-inversions-problem

Let A[1.. n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the pair (i, j) is called an inversion of A. A modified merge sort algorithm is developed that determines the number of inversions in any permutation on n elements in Θ(nlgn) worst-case time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Counting-inversions-problem

Let A[1.. n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the pair (i, j) is called an inversion of A. A modified merge sort algorithm is developed that determines the number of inversions in any permutation on n elements in Θ(nlgn) worst-case time.

About

Let A[1.. n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the pair (i, j) is called an inversion of A. A modified merge sort algorithm is developed that determines the number of inversions in any permutation on n elements in Θ(nlgn) worst-case time.


Languages

Language:Python 100.0%