Move minimum element at current i
key = a [ min_idx ] NEW_LINE while min_idx > i : NEW_LINE INDENT a [ min_idx ] = a [ min_idx - 1 ] NEW_LINE min_idx -= 1 NEW_LINE DEDENT a [ i ] = key NEW_LINE def printArray ( a , n ) : NEW_LINE for i in range ( n ) : NEW_LINE print ( " % d " % a [ i ] , end = " ▁ " ) NEW_LINE