The adaptive sorting problem is defined as any sorting algorithm
with its runtime proportional to the disorder of the
input sequence X. Estivill-Castro et al (Estivill-Castro &
Wood 1992) define an operation inv(X) to measure the
disorder of X, where inv(X) denotes the exact number
of inversions in X. (i; j) is an inversion if i < j and
xi > xj . The number of inversions is at most