Python3 program to implement min max selection sort .
def minMaxSelectionSort ( arr , n ) : NEW_LINE INDENT i = 0 NEW_LINE j = n - 1 NEW_LINE while ( i < j ) : NEW_LINE INDENT min = arr [ i ] NEW_LINE max = arr [ i ] NEW_LINE min_i = i NEW_LINE max_i = i NEW_LINE for k in range ( i , j + 1 , 1 ) : NEW_LINE INDENT if ( arr [ k ] > max ) : NEW_LINE INDENT max = arr [ k ] NEW_LINE max_i = k NEW_LINE DEDENT elif ( arr [ k ] < min ) : NEW_LINE INDENT min = arr [ k ] NEW_LINE min_i = k NEW_LINE DEDENT DEDENT DEDENT DEDENT