首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 八皇后VC图形演示,算法思想:回溯法,先在第1行放上一个皇后,然后在第2行合适的位置放上一个皇后,依次类推,如果8行都放满了,说明找到了一个解,如果第好第i行的...

八皇后VC图形演示,算法思想:回溯法,先在第1行放上一个皇后,然后在第2行合适的位置放上一个皇后,依次类推,如果8行都放满了,说明找到了一个解,如果第好第i行的...

  • 资源大小:50.81 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Windows开发

资 源 简 介

八皇后VC图形演示,算法思想:回溯法,先在第1行放上一个皇后,然后在第2行合适的位置放上一个皇后,依次类推,如果8行都放满了,说明找到了一个解,如果第好第i行的皇后后,第i+1行找不到合适的位置,这时就回到第i行,把第i行的皇后放到下一个位置,继续尝试下一行。如此反复,知道找到所有的解。注意,这种算法找的解可能有等价的,某些解可由别的解经过旋转棋盘得到。-visual demostration in vc of eight queens problem. algorithm: backtracking. First, put a queen on first line then find a suitable position on 2nd line for next queen, and so on. When all eight lines have queens, it means we have find a solution. If we put the i-th queen, but can find a suitable position on the (i+1)th line, then back to the ith line and move the queen on the ith line to next suitable position and move on to the next line. Repeat this until we have found all the solutions. Note:By this mean, some solutions maybe equivalent to others, some can be acquired by the rotation of other solutions.

文 件 列 表

VC
res
EightQueen.clw
ReadMe.txt
EightQueen.h
EightQueen.cpp
EightQueen.dsw
StdAfx.h
StdAfx.cpp
EightQueen.ncb
EightQueen.plg
EightQueen.dsp
Resource.h
QueenPanel.h
EightQueenDlg.h
EightQueenDlg.cpp
EightQueen.aps
EightQueen.rc
QueenPanel.cpp
EightQueen.opt
VIP VIP
0.203501s