Computer Science EngineeringHard

The number of inversions in the array [3, 1, 2, 5, 4] is

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 5

Correct answer: A. 3

The inversions are (3,1), (3,2) and (5,4).

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic