Counting InversionsMerge and count stepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 5two sorted halvesauxiliaryarrayTotal:6
6 Merge and count step. Given two sorted halves, count number of inversions where ai and aj are in different halves. Combine two sorted halves into sorted whole. two sorted halves auxiliary array i = 5 Total: 6 Counting Inversions
Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 41two sorted halvesauxiliaryarrayTotal:6
7 Merge and count step. Given two sorted halves, count number of inversions where ai and aj are in different halves. Combine two sorted halves into sorted whole. two sorted halves auxiliary array i = 4 Total: 6 Counting Inversions
Counting InversionsMerge and count stepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 4two sorted halvesauxiliaryarrayTotal:6
8 Merge and count step. Given two sorted halves, count number of inversions where ai and aj are in different halves. Combine two sorted halves into sorted whole. two sorted halves auxiliary array i = 4 Total: 6 Counting Inversions