Algorithms | Misc | Question 9

Last Updated :
Discuss
Comments

An inversion in a an array A[] is a pair (A[i], A[j]) such that A[i] > A[j] and i < j. An array will have maximum number of inversions if it is:

Sorted in increasing order
Sorted in decreasing order
Sorted in alternate fashion
Both A and B
Share your thoughts in the comments