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

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

于 2022-03-13 发布 文件大小:54.02 kB
0 182
下载积分: 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 个回复

  • A* search technique implementation code
    这是实现a*(a星)搜索算法的Jave代码。代码经过测试,是确定的;
    2022-03-25 08:29:22下载
    积分:1
  • An Optimized Formula for Alpha Blending Pixels
    An Optimized Formula for Alpha Blending Pixels
    2022-07-26 18:28:02下载
    积分:1
  • Classification algorithm based on support vector machine, after test results, we...
    基于支持向量机分类算法,经试验效果不错,取得了很好的分类效果-Classification algorithm based on support vector machine, after test results, well, and achieved very good classification results
    2022-03-05 15:28:17下载
    积分:1
  • 基于matlab的图像消雾
    用于改善图像中的浓雾效果,包括暗通道算法和retinex算法
    2022-01-26 00:34:38下载
    积分:1
  • C语言源代码 万年历
    C语言源代码 万年历-C language source code hefty almanac
    2022-10-05 02:45:03下载
    积分:1
  • 人工智能作业,用博弈树完成的一字棋程序。
    人工智能作业,用博弈树完成的一字棋程序。-Artificial intelligence operations, with the completion of the word chess game-tree program.
    2022-03-16 15:02:28下载
    积分:1
  • Fourier transform
    以C-Fourier变换为基础的编程,帮助有兴趣的爱好者。
    2022-08-09 21:40:23下载
    积分:1
  • 路由器选路DV
    能够选择用编程语言,模拟DV算法,找到某点到其他各点的最短路径软件:PC机软件:操作系统windows 7, 开发平台EclipseDV算法的实质就是针对某一个特定的节点,从它的邻居到网络中的可达的所有点。该点需要将它到其他邻居的耗散值广播给它的邻居,它也接受来自邻居的cost值信息,同时通过邻居给它的广播,更新自己到别的点的最短路径。几次过后,算法就会稳定下来。其中带有源码和实验报告。
    2022-08-14 01:53:30下载
    积分:1
  • Upload Files Without COM
    资源描述 详细介绍: 一套国外的搜索引擎,采用db数据库,不过是英文版的,经过修改我想一套正宗的SOHU系统也该诞生了! 
    2022-03-12 21:42:40下载
    积分:1
  • 数控加工仿真
    二维数控加工仿真VC源代码,希望对学习控加工仿真编程的朋友有用。源代码是VC6.0编译的,已经用VS2008从新编译过。欢迎大家下载使用。
    2022-04-15 03:47:49下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载