Java中用于Minimax算法的树表示

编程入门 行业动态 更新时间:2024-10-26 20:31:10
本文介绍了Java中用于Minimax算法的树表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在Java中实现Minimax算法. 我找不到很好的树表示形式.有没有现成的,或者我应该自己做?

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
推荐答案

您不需要一个.

经常用树来说明minimax算法.

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.

相反,您将使用 iteration 和递归.在树的每个内部节点上,您将遍历子级,并对每个子级使用递归.

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.

更多推荐

Java中用于Minimax算法的树表示

本文发布于:2023-11-29 19:17:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647377.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算法   Java   Minimax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!