Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and aareindifferenthalves.Combine two sorted halves into sorted wholei= 61two sorted halvesauxiliaryarrayTotal:
1 Counting Inversions 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 Total: i = 6
Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 61two sorted halvesauxiliaryarrayTotal:6
2 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. i = 6 two sorted halves auxiliary array Total: 6 Counting Inversions
Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 61two sorted halvesauxiliaryarrayTotal:6
3 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 = 6 Total: 6 Counting Inversions
Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 61two sorted halvesauxiliaryarrayTotal:6
4 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 = 6 Total: 6 Counting Inversions
Counting InversionsMergeandcountstepGiven two sorted halves, count number of inversions where a; and ajareindifferenthalves.Combine two sorted halves into sorted wholei= 51two sorted halvesauxiliaryarrayTotal:6
5 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