Tree representation in java for minimax algorithm

孤街醉人 提交于 2019-12-13 05:19:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!