马跑日算法
来源:互联网 发布:mac 的idea提示快捷键 编辑:程序博客网 时间:2024/06/05 15:48
算法:
#include <stdio.h>using namespace std;//开始计算;bool Search( Location curLoc ){ m_complex ; //修改棋盘标志; m_chessTable[ curLoc.x-1 ][ curLoc.y-1 ] = 1; //是否搜索成功结束标志; if( isSuccess() ) return true; //还有未走到的棋盘点,从当前位置开始搜索; else { //递归搜索未走过的棋盘点; for( int i = 0 ; i < 8 ; i ) { Location newLocation = GetSubTreeNode( curLoc , i ) ; if( isValide( newLocation ) && m_chessTable[newLocation.x-1][newLocation.y-1] == 0 ) { if( Search( newLocation ) == true ) { //填写记录表; MarkInTable( newLocation, curLoc ); return true; } } } } //搜索失败,恢复棋盘标志; m_chessTable[curLoc.x-1][curLoc.y-1] = 0; return false;}
0 0
- 马跑日算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 算法
- 数据库怎样把一个表的数据插入到另一个表
- struct和nuion
- 什么叫做生成树 Prim
- Android事件分发机制完全解析(上)
- Android Studio 导出APK
- 马跑日算法
- 十进制小数转二进制
- 1727 洪水拯救计划
- ffmpeg 编译环境搭建(ffmpeg-3.2)
- dispatchTouchEvent(),onTouchEvent(MotionEvent event),onInterceptTouchEvent(MotionEvent event)的事件处理
- uva1382 Distant Galaxy
- 精选2个小例子,带你快速入门Python文件处理
- IPControl控件获取主机IP
- python进行excel数据读写