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

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

于 2022-02-06 发布 文件大小:55.93 kB
0 230
下载积分: 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 个回复

  • VB实现的treap树程序含可视化界面
    BST树是一种二叉查找树,但是若是多次插入,BST树便会失衡或者退化成链。于是在BST树的基础上又附加了一个堆的性质,本程序采用最小堆原则。程序代码使用的是VB6.0编写,由于VB中没有指针,所有本程序采用数组模拟,程序一方面实现了treap的算法,另一方面也加了可视化操作界面,非常直观。
    2022-10-26 23:50:04下载
    积分:1
  • looking for the smallest number. Cpp C Algorithm
    找最小数.cpp C++算法-looking for the smallest number. Cpp C Algorithm
    2022-08-07 08:04:26下载
    积分:1
  • 数据结构中哈夫曼树的C语言实现
    给定n个权值作为n的叶子结点,构造一棵二叉树,若带权路径长度达到最小,称这样的二叉树为最优二叉树,也称为哈夫曼树(Huffman tree)。哈夫曼树是带权路径长度最短的树,权值较大的结点离根较近。该代码实现了哈夫曼树,供大家参考学习。
    2022-12-10 22:10:03下载
    积分:1
  • 一个简单的递归实现八皇后
    一个简单的递归实现八皇后算法-a simple recursive algorithm to achieve eight Queen"s
    2022-04-14 18:07:05下载
    积分:1
  • 计字符串类并给出其基本操作和运符重载的实现。
    计字符串类并给出其基本操作和运算符重载的算法实现。
    2022-03-10 12:57:47下载
    积分:1
  • Dijkstra
    用C#实现的一种Dijkstra高效算法,有实例代码,可以参考一下。里面有一个类Dijkstragao,在Program的买你函数里有调用的实例。调用比较简单,好用。
    2022-01-25 15:34:17下载
    积分:1
  • //=== === === === === === ===== //函数说明 //函数名称:Correlation //函数功能:计最小二乘拟合...
    //=== === === === === === ===== //函数说明 //函数名称:Correlation //函数功能:计算最小二乘法拟合的多项式的相关系数 //使用方法:int M------拟合多项式的项数(已知条件) // double *b---拟合曲线的系数,按升次排列(已知条件) // double *x---结点x轴数据(已知条件) // double *y---结点y轴数据(已知条件) // double *Yg--结点估计值,与*y相对应,个数为m(过程变量) // int m------结点个数(已知条件) //注意事项:多项式阶数最高为10,多项式的形式为 y = b0 + b1*(x-Xavr)... -//=== === === === === === === === === === === =====// Function that// function name: Correlation// Function: Calculation of the polynomial least squares fitting correlation coefficient// Usage: int M------ polynomial fitting the number of (known conditions)// double* b-- Fitting curve coefficient, or times by arrangement (known conditions)// double* x--- node x-axis data (known conditions)// double* y--- node y-axis data (already known conditions)// double* Yg- the estimated value of node, and* y correspond to the number for m (process variables)// int m------ node number (known conditions)// Note: polynomial order up to 10, the polynomial
    2023-05-06 14:40:03下载
    积分:1
  • 概念格挖掘关联规则的论文及源代码,程序附在论文的最后,请注意查看,绝对有效...
    概念格挖掘关联规则的论文及源代码,程序附在论文的最后,请注意查看,绝对有效 -concept lattice Mining Association Rules papers and source code, procedures attached to the final paper, to look and totally effective
    2023-08-30 18:05:03下载
    积分:1
  • 高斯积分
    近似I=三重积分((f(x,y,z)dz dy dx)),用
    2022-05-30 23:49:27下载
    积分:1
  • newton interpolation
    newton interpolation
    2023-01-22 18:45:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载