Optimization and Generalization of Minimax Algorithms