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
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?
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.