plz solve
.
find the two lines that contains inversion
give right answers
Attachments:
Answers
Answered by
1
Answer:
Explanation:
Anversion Count for an array indicates – how far (or close) the array is from being sorted. If array is already sorted then inversion count is 0. If array is sorted in reverse order that inversion count is the maximum.
Formally speaking, two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j
Example:
Input: arr[] = {8, 4, 2, 1}
Output: 6
Explanation: Given array has six inversions:
(8,4), (4,2),(8,2), (8,1), (4,1), (2,1).
Input: arr[] = {3, 1, 2}
Output: 2
Explanation: Given array has two inversions
Similar questions
Math,
3 months ago
Environmental Sciences,
3 months ago
Hindi,
3 months ago
English,
6 months ago
Social Sciences,
6 months ago
Physics,
9 months ago
Social Sciences,
9 months ago