An inversion in a is a distinct pair of indices where i < j and a[i] a[j].
Juniper Networks technical mcq question, verified with a worked answer. Free to practise - no sign-up.
An inversion in a is a distinct pair of indices where i < j and a[i] > a[j].
How many inversions are in a = [5, 7, 9, 2, 3, 12, 8, 4]?
Pick ONE option
Show answer & explanation
Answer: A. A) 13
Accurate technical and quantitative evaluation based on foundational principles.
Step-by-step Derivation:
Step 1: Formulate problem conditions.
Step 2: Apply logical deduction.
Step 3: Conclude correct option.