EightQueensProblem:用爬山法解决八皇后问题

时间:2024-05-19 02:49:01
【文件属性】:

文件名称:EightQueensProblem:用爬山法解决八皇后问题

文件大小:8KB

文件格式:ZIP

更新时间:2024-05-19 02:49:01

Java

八皇后问题 用爬山法解决八皇后问题 import java.util.ArrayList; import java.util.List; import java.util.Random; public class ChessBoard { public static int Q= 8; private int[][] board; private int[] queenPositions; public static void main(String[] args) { boolean climb = true; int climbCount = 0; while (climb) { ChessBoard board = new ChessBoard( new int[Q][Q], new int[8]); board.placeQueens()


【文件预览】:
EightQueensProblem-master
----ChessBoard()
--------bin()
--------src()
----README.md(6KB)

网友评论