登录
首页 » 算法 » 素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

于 2022-03-13 发布 文件大小:54.02 kB
0 126
下载积分: 2 下载次数: 1

代码说明:

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束条件即可 1.与前面所有的数不重复 2.与前一个数和为素数(最后一个和第一个也要满足)。 〖算法流程〗 1、数据初始化; 2、递归填数: 判断第J种可能是否合法; A、如果合法:填数;判断是否到达目标(10个已填完): 是,打印结果;不是,递归填下一个; B、如果不合法:选择下一种可能;-Prime Central: 1-10 from 10 the number of put this into a ring, asked the two adjacent numbers and is a prime number. 〗 〖Analysis is a retrospective this topic. From 1 year, 9 out of every space possible, each may be bound by the conditions of accession to 1. And in front of all the number of non-repetition, 2. With a few and for a prime number (the last and the first to meet). 1〗 〖algorithm processes the data to initialize 2, fill in the number of recursion: first to determine the legality of J possible A, if the legitimate: the number of Reclamation to determine whether the target (10 have been completed): Yes, print the results of not, fill in the next recursive B, if not legitimate: a possible alternative

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

发表评论

0 个回复

  • 数组为8位char型数值,通过该函数可以计出数组的16位循环校验码。...
    数组为8位char型数值,通过该函数可以计算出数组的16位循环校验码。-Array for the 8-bit char type values can be calculated through the function of an array of 16 cycle parity-check codes.
    2023-06-20 15:25:03下载
    积分:1
  • 8 益智受理的启发式
    可受理的启发式算法 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报 打分 发表评论 暂无评论 0 粉丝 0 发布 0 获赞 关注 查看主页 java算法启发式 相关源码推荐 猜数字游戏 0 0 暂无评分Bender 分解算法matlab实现 0 0 暂无评分汉诺塔解法 0 0 暂无评分汽车租赁系统1.0 0 0 暂无评分spring-boot-jdbctemplate 0 0 暂无评分 介绍信息预览(0条)评论打分
    2022-03-12 12:40:31下载
    积分:1
  • with C++ Builder bankers algorithm can process arbitrary importation of all type...
    用C++Builder实现的银行家算法可以任意 输入进程个数各类资源的个数输出安全序列-with C++ Builder bankers algorithm can process arbitrary importation of all types of resources the number of security Sequence Number output
    2022-07-08 07:47:37下载
    积分:1
  • 三态树:一个树控件的派生控件,完成item的三种状态
    三态树:一个树控件的派生控件,完成item的三种状态-Tri-state tree: A tree control derivative controls, the three states to complete item
    2023-02-04 00:25:04下载
    积分:1
  • VB_PC-DMIS
    在v40 PC-DMIS脚本函数用于定制DMIS出口(后) 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2023-05-30 19:10:03下载
    积分:1
  • GNPython代码
    Market Newman写的复杂网络的加权GN算法 算法用Python写的 其基本思想是不断的删除网络中具有相对于所有源节点的最大的边介数(ege betweenness)的边,然后,再重新计算网络中剩余的边的相对于所有源节点的边介数,重复这个过程,直到网络中,所有边都被删除。
    2022-03-19 07:03:37下载
    积分:1
  • Discrete Fourier Transform
    离散分数阶傅立叶变换-Discrete Fourier Transform
    2023-04-06 14:05:04下载
    积分:1
  • 此程序为分段最小二乘曲线拟合,可对一模型进行分段拟合,增加准确性和精确度....
    此程序为分段最小二乘算法曲线拟合,可对一模型进行分段拟合,增加准确性和精确度.-This program is sub-least-squares curve fitting algorithm can be fitted to a sub-model to increase the accuracy and precision.
    2022-07-25 01:02:12下载
    积分:1
  • 帮助你迅速理解PCA的java程序
    本程序是实现PCA算法的一个完整java程序。代码的层次清晰,包含特征值和特征向量的提取等。能让你迅速了解并学会PCA算法。程序中包含测试数据,只要变换测试数据,就可以运行你想应用的数据库。
    2022-03-13 05:41:09下载
    积分:1
  • 旁瓣电平的圆阵天线LOW合成
    这种模拟的雷达系统设计。元素或正在使用的类型是天线的偶极子天线。这种编码实现 MATLAB 软件中找到和情节的 polardB,也想要绘制了天线的辐射模式。这种情况下,圆形天线阵列用于查找辐射模式。
    2022-12-01 00:40:03下载
    积分:1
  • 696518资源总数
  • 105540会员总数
  • 37今日下载