if parent is smaller than child then swapping parent with child having higher value
if index < i and arr [ j ] < arr [ index ] : NEW_LINE INDENT arr [ j ] , arr [ index ] = arr [ index ] , arr [ j ] NEW_LINE DEDENT j = index NEW_LINE if index >= i : NEW_LINE INDENT break NEW_LINE DEDENT