Counting Inversions Pseudocode, First, we divide the array into two halves: left half and right half.