登录
首页 » 算法 » 回溯法解N后的C++源码(Visual Stdio2010环境测试通过)

回溯法解N后的C++源码(Visual Stdio2010环境测试通过)

于 2022-02-06 发布 文件大小:55.93 kB
0 236
下载积分: 2 下载次数: 1

代码说明:

#include #include #include #include using namespace std;class Queen{ friend int nQueen(int);private: bool Place(int k); void Backtrack(int t); void Output(); int n,//皇后个数  *x;//当前解 long sum;//当前已找到的可行性方案数};bool Queen::Place(int k){ for (int j=1;jn) {  sum++;  Output(); } else {  for (int i=1;i

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • the Capacitated Vehicle Routing Problem
    The CVRP is a hard combinatorial optimisation problem. The scenario is that a set of depots contains goods to be delivered to customers by a fleet of trucks. Each customer wants a certain integer amount of goods called their demand and each truck can only carry a certain amount called its capacity. All trucks have the same capacity. The objective is to find a set of routes, one for each truck, which minimises the total distance travelled by all trucks (the  请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2022-06-15 10:54:51下载
    积分:1
  • C语言实践
    通过一个简单的实例,实现一个C语言的经典算法,而且这个代码在我们实践中,也会经常用到,并将其进行模板话,这样就可以随时拿来使并可以将其封装成一个固有的库来实现
    2022-02-05 05:35:21下载
    积分:1
  • 有限元计程序,供软件工程,力学专业的老师和学生参考
    有限元计算程序,供软件工程,力学专业的老师和学生参考-Finite element program for software engineering, mechanical professional teachers and students for reference
    2022-11-01 20:40:03下载
    积分:1
  • 猜数字游戏c版 汉诺塔游戏递归解c版
    猜数字游戏c版 汉诺塔游戏递归解法c版-viewing game version of the game HANOR recursive solution c version
    2022-07-01 08:33:58下载
    积分:1
  • 集回归计、检验、方程输出为一体的逐步回归源码分享
    这是我自己编写的一个完整的实现逐步回归算法的模块,只要给定数据文件、检验信度和输出文件,一切中间过程和最后回归结果都清晰可见,最大特点是自动计算出检验信度值,避免了信度查表和手工输入的麻烦,值的拥有!压缩包内含有调用实例,用户使用非常方便。
    2022-08-21 21:24:28下载
    积分:1
  • 双链表c实现
    数据结构最基本的算法,双链表的c实现,包括创建,删除,修改,增加成员等操作
    2022-03-22 20:09:31下载
    积分:1
  • 一个方便的求积分的类
    一个方便的求积分的类-a convenient points for the category
    2022-04-08 11:00:35下载
    积分:1
  • 禁忌搜索对初始解、邻域个数及禁忌列表的大小等参数有比较严格的要求, 这些参数直接影响着的优化能 力。文章提出了一种改进的禁忌搜索, 它用有效空间来压...
    禁忌搜索法对初始解、邻域个数及禁忌列表的大小等参数有比较严格的要求, 这些参数直接影响着算法的优化能 力。文章提出了一种改进的禁忌搜索法, 它用有效空间来压缩搜索范围, 这样可以提高搜索效率和全局搜索能力。用短期 和长期禁忌列表存储器来保证算法能搜索到全局空间的每一点, 并且不重复搜索。经过验算和分析, 证明它是一种较好的 全局启发式搜索法-Tabu search method, the initial solution, neighborhood and tabu list size of the number of parameters such as have more stringent requirements, these parameters directly affect the ability to optimize the algorithm. This paper presents an improved tabu search method, it is used effectively to compress the search space, so that can improve search efficiency and global search capabilities. Short-term and long-term memory tabu list to ensure the algorithm to search to the global space, each point, and do not repeat the search. After checking and analysis, to prove that it is a good global heuristic search method
    2022-04-06 20:06:04下载
    积分:1
  • WaveEdit音频编辑的源代码
    一个关于音频编辑的源代码。包括快进,慢放等 -Audio editing on the source code. Including fast forward, slow motion, etc.
    2023-03-27 16:30:03下载
    积分:1
  • 经典之背包问题
    经典算法之背包问题-classic algorithms knapsack problem
    2022-01-29 00:49:05下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载