TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
returns which is the longest/shortest number using minimax algorithm More...
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
Go to the source code of this file.
Namespaces | |
namespace | backtracking |
for vector container | |
Functions | |
template<size_t T> | |
int | backtracking::minimax (int depth, int node_index, bool is_max, const std::array< int, T > &scores, double height) |
Check which is the maximum/minimum number in the array. | |
int | main () |
Main function. | |
returns which is the longest/shortest number using minimax algorithm
Minimax (sometimes MinMax, MM or saddle point) is a decision rule used in artificial intelligence, decision theory, game theory, statistics, and philosophy for minimizing the possible loss for a worst case (maximum loss) scenario. When dealing with gains, it is referred to as "maximin"—to maximize the minimum gain. Originally formulated for two-player zero-sum game theory, covering both the cases where players take alternate moves and those where they make simultaneous moves, it has also been extended to more complex games and to general decision-making in the presence of uncertainty.
Definition in file minimax.cpp.
int main | ( | void | ) |
Main function.
Definition at line 56 of file minimax.cpp.