问题
I want to implement the Minimax algorithm in java. I couldnt find a good tree representation. Is there an existing one or should I make my own?
- by the way this is for the pacman game Thanks
回答1:
You don't need one.
The minimax algorithm is frequently illustrated with a tree.
However, that tree represents the steps taken by the algorithm to choose the best move. It is not a data structure held by the algorithm.
Instead, you'll use iteration and recursion. At each interior node of the tree, you'll iterate through the children, and use recursion on each child.
来源:https://stackoverflow.com/questions/27249304/tree-representation-in-java-for-minimax-algorithm