Function to implement merge sort
def mergeSort ( v , left , right , inversions ) : NEW_LINE INDENT if ( left < right ) : NEW_LINE INDENT mid = ( left + right ) // 2 NEW_LINE mergeSort ( v , left , mid , inversions ) NEW_LINE mergeSort ( v , mid + 1 , right , inversions ) NEW_LINE merge ( v , left , mid , right , inversions ) NEW_LINE DEDENT DEDENT