MinMaxAlgorithm